bg dZddlZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z m Z mZmZmZddlmZddlmZmZmZGddeZGd d eZGd d eZGd deZGddeZGddeZGddeZGddeZGddeZGddeZ Gdde Z!Gdde Z"Gdd e Z#Gd!d"eZ$Gd#d$eZ%Gd%d&eZ&Gd'd(eZ'Gd)d*eZ(Gd+d,eZ)Gd-d.eZ*Gd/d0eZ+Gd1d2eZ,e-d3krej.dSdS)4z$Unittest for fake_filesystem module.N)fake_filesystemfake_os fake_open)set_uidset_gidis_root reset_idsOSType)IS_WIN)TestCaseRealFsTestCase time_mockceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdS)FakeDirectoryUnitTestcTtjd|_tj|j|_t dd|_|jtj dd|j|_ tj d|j |_ dS) N/path_separator foobar dummy_file)contents filesystemsomedirr) rFakeFilesystemrr FakeOsModuleosrtimestartFakeFile fake_file FakeDirectoryfake_dirselfs t/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyfakefs/tests/fake_filesystem_test.pysetUpzFakeDirectoryUnitTest.setUp%s)8LLL&t77b!$$  (1 |   (5 $/    c8|jdSN)r stopr&s r(tearDownzFakeDirectoryUnitTest.tearDown1s r*c|tj|jjz|tj|jjz|i|jjdSr,) assertTruestatS_IFREGr#st_modeS_IFDIRr% assertEqualentriesr&s r(test_new_file_and_directoryz1FakeDirectoryUnitTest.test_new_file_and_directory4s_  t~'==>>>  t}'<<=== T]233333r*c|j|j|d|ji|jjdSNr)r% add_entryr#r5r6r&s r(test_add_entryz$FakeDirectoryUnitTest.test_add_entry9sB /// (DN3T]5JKKKKKr*c|j|j||j|jddSr9)r%r:r#r5 get_entryr&s r(test_get_entryz$FakeDirectoryUnitTest.test_get_entry=sH /// )@)@)J)JKKKKKr*c0|jj}|jj|j|j|j||d|jj||d|jjdS)Nzsomedir/foobarr)r root_dir_namerootr:r%r#r5pathr'root_dirs r( test_pathzFakeDirectoryUnitTest.test_pathAs?0 &&t}555 /// H444dn6IJJJ H---t}/ABBBBBr*cd|j_d}|j||j|}|||jdSNTzC:/foo/bar/baz)r is_windows_fs create_dir get_objectr5rBr'dir_path dir_objects r(test_path_with_drivez*FakeDirectoryUnitTest.test_path_with_driveHsZ(,%# ""8,,,_//99  :?33333r*c|jj}d}|j||j||j|}||d|jdS)N /foo/bar/baz foo/bar/baz)rr@rIrchdirrJr5rB)r'rDrLrMs r(test_path_after_chdirz+FakeDirectoryUnitTest.test_path_after_chdirOsw?0! ""8,,,  h_//99  H111:?CCCCCr*cd|j_d}|j||j||j|}|||jdSrG)rrHrIrrRrJr5rBrKs r( test_path_after_chdir_with_drivez6FakeDirectoryUnitTest.test_path_after_chdir_with_driveWsn(,%# ""8,,,  h_//99  :?33333r*cx|j|j||j|jd|jd|t5|jdddddS#1swxYwYdSr9)r%r:r#r5r= remove_entry assertRaisesKeyErrorr&s r(test_remove_entryz'FakeDirectoryUnitTest.test_remove_entry_s /// )@)@)J)JKKK ""8,,,   x ( ( . . M # #H - - - . . . . . . . . . . . . . . . . . .sB//B36B3c|tj5d|j_ddddS#1swxYwYdSNg?raises_os_errorerrnoENOSPCr#sizer&s r(,test_should_throw_if_set_size_is_not_integerzBFakeDirectoryUnitTest.test_should_throw_if_set_size_is_not_integerfs  ! !%, / / & &"%DN  & & & & & & & & & & & & & & & & & & :>>c|tj5d|j_ddddS#1swxYwYdSNr]r&s r()test_should_throw_if_set_size_is_negativez?FakeDirectoryUnitTest.test_should_throw_if_set_size_is_negativejs  ! !%, / / % %"$DN  % % % % % % % % % % % % % % % % % %rcc^d|j_|d|jjdSNrr#rar5rr&s r(+test_produce_empty_file_if_set_size_is_zerozAFakeDirectoryUnitTest.test_produce_empty_file_if_set_size_is_zeron- T^455555r*c^d|j_|d|jjdSrirkr&s r(+test_sets_content_empty_if_set_size_is_zerozAFakeDirectoryUnitTest.test_sets_content_empty_if_set_size_is_zerorrmr*c^d|j_|d|jjdS)Ndummy_rkr&s r(7test_truncate_file_if_size_is_smaller_than_current_sizezMFakeDirectoryUnitTest.test_truncate_file_if_size_is_smaller_than_current_sizevs- 4>#:;;;;;r*c^d|j_|d|jjdS)Nrrrkr&s r(:test_leave_file_unchanged_if_size_is_equal_to_current_sizezPFakeDirectoryUnitTest.test_leave_file_unchanged_if_size_is_equal_to_current_sizezs-  t~'>?????r*c|d|j_|tj5|jddddn #1swxYwYd|j_|tj5|jdddddS#1swxYwYdS)NTaF)rrHr^r_EISDIRr% set_contentsr&s r(test_set_contents_to_dir_raisesz5FakeDirectoryUnitTest.test_set_contents_to_dir_raises~s'(,%  ! !%, / / , , M & &s + + + , , , , , , , , , , , , , , ,(-%  ! !%, / / , , M & &s + + + , , , , , , , , , , , , , , , , , ,s#AAA B11B58B5c^d|j_|d|jjdS)N z dummy_filerkr&s r(=test_pads_with_nullbytes_if_size_is_greater_than_current_sizezSFakeDirectoryUnitTest.test_pads_with_nullbytes_if_size_is_greater_than_current_sizes.  +T^-DEEEEEr*c|d|jjd|j_|d|jjd|j_|d|jjdS)Nr)r5r#st_mtimer&s r(test_set_m_timez%FakeDirectoryUnitTest.test_set_m_timesm T^4555"$ T^4555"% dn566666r*ctjd}tj|}d}||d|d||t j||}d|_ | d||t jdS)Nrr some_file1zcontents here1rr+) rrrr create_file assertLessr1ST_INOrJst_inor5)r'rfake_os_module file_pathfile_objs r(test_file_inodez%FakeDirectoryUnitTest.test_file_inodes$33GGG  -j99 y3CDDD >..y99$+FGGG((33 ^00;;DKHIIIIIr*ctjd}tj|}d}|||d||t j||}d|_ | d||t jdS)Nrrtestdirrr) rrrrrIrr1rrJrr5)r'rrdirpathdir_objs r(test_directory_inodez*FakeDirectoryUnitTest.test_directory_inodes$33GGG  -j99g&&& >..w77 DEEE''00 ^0099$+FGGGGGr*ctjd}|d}|dd|d}|dd |d d |d }|d d|dd|d|j|d|j|d|j|d|jj|tj 5d|_ddddS#1swxYwYdS)Nrr/fooz /foo/bar.txtst_sizez /foo/bar/z/foo/bar/baz1.txtz/foo/bar/baz2.txt(z/foo1z /foo1/bar.txt2z/foo1/bar/baz/file<ZFnd) rrrIrr5rarDr^r_rx)r'fsfoo_dirbar_dirfoo1_dirs r(test_directory_sizez)FakeDirectoryUnitTest.test_directory_sizes  +3 ? ? ?--'' ~r222-- ,, *B777 *B777==)) 333 +R888 W\*** W\*** hm,,, bk.///  ! !%, / /  HM                  sE--E14E1cftjd}|d|d|d|d|d|d}|gd|jdS) Nrrrz/foo/2z/foo/4z/foo/1z/foo/3)2413)rrrIrrJr5 ordered_dirs)r'rr%s r(test_ordered_dirsz'FakeDirectoryUnitTest.test_ordered_dirss$33GGG f%%%x(((x(((x(((x(((((00 ---x/DEEEEEr*N)__name__ __module__ __qualname__r)r.r7r;r>rErNrSrUrZrbrgrlrorsrurzr}rrrrrr*r(rr$s    444 LLLLLLCCC444DDD444...&&&%%%666666<<<@@@,,,FFF777 J J J H H H   "FFFFFr*rc&eZdZdZdZdZdZdS)SetLargeFileSizeTestcbtj}tjd||_dS)Nrr)rrr"r#r'rs r(r)zSetLargeFileSizeTest.setUps+$355 (1(zRRRr*c|tj5|jdddddS#1swxYwYdSr\r^r_r`r#set_large_file_sizer&s r((test_should_throw_if_size_is_not_integerz=SetLargeFileSizeTest.test_should_throw_if_size_is_not_integers  ! !%, / / 4 4 N . .s 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4AA A c|tj5|jdddddS#1swxYwYdSrerr&s r(%test_should_throw_if_size_is_negativez:SetLargeFileSizeTest.test_should_throw_if_size_is_negatives  ! !%, / / 3 3 N . .r 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3rc|jd|d|jj|d|jjdS)Niʚ;)r#rr5rrr&s r(6test_sets_content_none_if_size_is_non_negative_integerzKSetLargeFileSizeTest.test_sets_content_none_if_size_is_non_negative_integersT **:666 t~6777 T^%;<<<<GetPathComponentsTest.test_empty_path_should_return_empty_lists. T_==bAABBBBBr*cd|dg|jddSNfoorr&s r(=test_relative_path_with_one_component_should_return_componentzSGetPathComponentsTest.test_relative_path_with_one_component_should_return_components0 %$/"B"B5"I"IJJJJJr*cd|dg|jddS)Nrrrr&s r(=test_absolute_path_with_one_component_should_return_componentzSGetPathComponentsTest.test_absolute_path_with_one_component_should_return_component s0 %$/"B"B6"J"JKKKKKr*cf|ddg|jddS)Nrrrrr&s r(5test_two_level_relative_path_should_return_componentszKGetPathComponentsTest.test_two_level_relative_path_should_return_components s2 %)I)I))T)TUUUUUr*cf|ddg|jddS)Nrrrrr&s r(5test_two_level_absolute_path_should_return_componentszKGetPathComponentsTest.test_two_level_absolute_path_should_return_componentss2 %)I)I*)U)UVVVVVr*N) rrrr)rrrrrrrr*r(rrsOOOCCCKKKLLLVVVWWWWWr*rcLeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6S)7FakeFilesystemUnitTestctjd|_|jj|_tjd|j|_tjd|j|_tjd|j|_ dS)Nrrrrfoobazquux) rrrr@rr"r#r$ fake_childfake_grandchildr&s r(r)zFakeFilesystemUnitTest.setUps)8LLL6(1(tWWW)7     /< t   r*c|d|jj|tj|jjjz|i|jjj dS)Nr) r5rrr0r1r4rAr3rDr6r&s r(test_new_filesystemz*FakeFilesystemUnitTest.test_new_filesystemsb do<===  t';'CCDDD T_5=>>>>>r*c|t5|jdddddS#1swxYwYdSr,)rX TypeErrorrexistsr&s r(test_none_raises_type_errorz2FakeFilesystemUnitTest.test_none_raises_type_error$s   y ) ) ) ) O " "4 ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )sAA Ac`||jddSr) assertFalserrr&s r( test_empty_string_does_not_existz7FakeFilesystemUnitTest.test_empty_string_does_not_exist(s, //3344444r*cj||j|jdSr,)r0rrrr&s r(test_exists_rootz'FakeFilesystemUnitTest.test_exists_root+s, ..t~>>?????r*ct||j|jjdSr,)rrrr#namer&s r(test_exists_unadded_filez/FakeFilesystemUnitTest.test_exists_unadded_file.s1 //0CDDEEEEEr*cd}|j|d||j|dzdS)Nrbazr/baz)rrrrr'rs r(0test_not_exists_subpath_named_like_file_contentszGFakeFilesystemUnitTest.test_not_exists_subpath_named_like_file_contents1sQ  ##I#>>> // F0BCCDDDDDr*c||jj|j|jdSr,)r5rrDrJrr&s r(test_get_root_objectz+FakeFilesystemUnitTest.test_get_root_object7sA  O $ O & &t~ 6 6     r*c|j|j|j|d|ji|jjjdSr9)r add_objectrr#r5rDr6r&s r(test_add_object_to_rootz.FakeFilesystemUnitTest.test_add_object_to_root=sI ""4>4>BBB (DN3T_5M5UVVVVVr*cd|j_|d|jjd|j_|d|jjd|j_|d|jjdS)NTzC:/zE:/foozE:/z //foo/barz //foo/bar/)rrHr5r@rr&s r(test_windows_root_dir_namez1FakeFilesystemUnitTest.test_windows_root_dir_nameAsw(,%  =>>>&  =>>>) t'DEEEEEr*c|j|j|j||j|jjdSr,)rr rr#r0rrr&s r(test_exists_added_filez-FakeFilesystemUnitTest.test_exists_added_fileIsK ""4>4>BBB ..t~/BCCDDDDDr*c"d|j_|jd|jd||jd||jd||jd||jd||jdd |j_||jd ||jd ||jd ||jd ||jddS)NF /a/b/file_one /a/c/file_twoa/b/../c/file_two/a/c/../b/file_one/a/c/../../a/b/file_one a/b/../z/da/b/../z/../c/file_twoz/a/c ../b/file_one../../a/b/file_one../../a/b/../../a/c/file_two ../z/file_one../z/../c/file_two)rrHrr0rrrr&s r(test_exists_relative_path_posixz6FakeFilesystemUnitTest.test_exists_relative_path_posixMs(-% ##O444 ##O444 ../BCCDDD ../CDDEEE ../HIIJJJ // ==>>> //0HIIJJJ$ ..??@@@ ../CDDEEE ../MNNOOO //@@AAA //0DEEFFFFFr*c:d|j_d|j_|jd|jd||jd||jd||jd||jd||jd d |j_||jd ||jd ||jd ||jd||jddS)NTFrrrrrrrzC:/a/crrrrr)rrHis_macosrr0rrrr&s r(!test_exists_relative_path_windowsz8FakeFilesystemUnitTest.test_exists_relative_path_windows]s(,%#(  ##O444 ##O444 ../BCCDDD ../CDDEEE ../HIIJJJ // ==>>> ../GHHIII& ..??@@@ ../CDDEEE ../MNNOOO //@@AAA ../CDDEEEEEr*c|j|j|j||j|jddSr9)rr rr#r5rJr&s r(test_get_object_from_rootz0FakeFilesystemUnitTest.test_get_object_from_rootnsL ""4>4>BBB )C)CH)M)MNNNNNr*cZ|j|j|j||j|jd|tj5|jdddddS#1swxYwYdS)Nrsome_bogus_filename) rr rr#r5rJr^r_ENOENTr&s r(+test_get_nonexistent_object_from_root_errorzBFakeFilesystemUnitTest.test_get_nonexistent_object_from_root_errorrs ""4>4>BBB )C)CH)M)MNNN  ! !%, / / > > O & &'< = = = > > > > > > > > > > > > > > > > > >s8B  B$'B$cP|j|j|j|j|jj|tj5|j |jjddddS#1swxYwYdSr,) rr rr# remove_objectrr^r_r'rJr&s r(test_remove_object_from_rootz3FakeFilesystemUnitTest.test_remove_object_from_rootxs ""4>4>BBB %%dn&9:::  ! !%, / / < < O & &t~': ; ; ; < < < < < < < < < < < < < < < < < 4>BBB %%dn&9::: //0CDDEEEEEr*cJ|j|j|j|j|jj|j||jj|ji|jj|jjj dSr,) rr rrrr#r5rDr=r6r&s r(test_add_object_to_childz/FakeFilesystemUnitTest.test_add_object_to_childs ""4>4?CCC ""4?#7HHH  ^ $. 1 O $ . .t/C D D L     r*c6d|j_|j|jj|j|t j5|j|jj|jddddS#1swxYwYdSNF) rrHr r@r#r^r_ENOTDIRrr&s r(+test_add_object_to_regular_file_error_posixzBFakeFilesystemUnitTest.test_add_object_to_regular_file_error_posixs(-% ""4?#@$.QQQ  ! !%- 0 0 L L O & &t~':DN K K K L L L L L L L L L L L L L L L L L Ls+BBBc,d|j_|j|j|j|t j5|j|jj|jddddS#1swxYwYdSNT) rrHr rr#r^r_r'rr&s r(-test_add_object_to_regular_file_error_windowszDFakeFilesystemUnitTest.test_add_object_to_regular_file_error_windowss(,% ""4>4>BBB  ! !%, / / L L O & &t~':DN K K K L L L L L L L L L L L L L L L L L Ls+B  B B c\|j|j|j|j|jj|j|j|jj|jj}||j|dSr,) rr rrrr# joinpathsr0rrs r(test_exists_file_added_to_childz6FakeFilesystemUnitTest.test_exists_file_added_to_childs ""4>4?CCC ""4?#7HHH(()=t~?RSS ..t4455555r*c d|j|j|j|j|jj|j||j|j|j|jj|jjdSr,) rr rrrr#r5rJr;r&s r(test_get_object_from_childz1FakeFilesystemUnitTest.test_get_object_from_childs ""4>4?CCC ""4?#7HHH  N O & &))$/*>@STT       r*c|j|j|j|j|jj|j|tj5|j |j |jjdddddS#1swxYwYdSr-) rr rrrr#r^r_r'rJr;r&s r(,test_get_nonexistent_object_from_child_errorzCFakeFilesystemUnitTest.test_get_nonexistent_object_from_child_errors ""4>4?CCC ""4?#7HHH  ! !%, / /   O & &))$/*>@UVV                     s/>B::B>B>c|j|j|j|j|jj|j|j|jj|jj}|j||tj 5|j |ddddS#1swxYwYdSr,) rr rrrr#r;r*r^r_r'rJ)r' target_paths r(test_remove_object_from_childz4FakeFilesystemUnitTest.test_remove_object_from_childs  ""4>4?CCC ""4?#7HHHo// O $."5   %%k222  ! !%, / / 4 4 O & &{ 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4s8C  C$'C$c:|j|j|j|t j5|j|j|jj dddddS#1swxYwYdSr-) rr rrr^r_r'r*r;rr&s r(#test_remove_object_from_child_errorz:FakeFilesystemUnitTest.test_remove_object_from_child_errors ""4>4?CCC  ! !%, / /   O ) )))$/*>@UVV                     s>BBBc@|j|j|j|t j5|j|jd|jj zdddddS#1swxYwYdS)Nz%s1file_does_not_matter_since_parent_not_a_directory) rr rr#r^r_r5r*r;rr&s r(+test_remove_object_from_non_directory_errorzBFakeFilesystemUnitTest.test_remove_object_from_non_directory_errors ""4>4>BBB  ! !%- 0 0   O ) )))4>..G                     sABBBc|j|j|j|j|jj|j|j|jj|jj}|j|||j |dSr,) rr rrrr#r;r*rrrs r(#test_exists_file_removed_from_childz:FakeFilesystemUnitTest.test_exists_file_removed_from_childs ""4>4?CCC ""4?#7HHH(()=t~?RSS %%d+++ //5566666r*c |j|j|j|j|jj|j|j|jj|jj}|j||jj}|t5|j |dddn #1swxYwY|j||j| |j|j || |j ||j||t5|j |dddn #1swxYwY||j |dSr,)rr rrrrr;r#rXOSErrorrJr5r0rr*r)r'grandchild_directorygrandchild_files r($test_operate_on_grandchild_directoryz;FakeFilesystemUnitTest.test_operate_on_grandchild_directorys. ""4>4?CCC ""4?#79MNNN#88 O $"6";  /33 $."5    w ' ' 8 8 O & & 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ""#7HHH )C)CO)T)TUUU ..??@@@ %%o666   w ' ' 8 8 O & & 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 //@@AAAAAs$>C%%C),C)$G  GGc0d}|j||j|}|tj||j|tj |j zdSr rrIrJr5rrBbasenamerr0r1r4r3r'rBnew_dirs r('test_create_directory_in_root_directoryz>FakeFilesystemUnitTest.test_create_directory_in_root_directorys{ ""4(((/,,T22 ))$//>>>  w677777r*cd}|j||tj5|j|ddddS#1swxYwYdSrrrIr^r_EEXISTrs r(>>  w67774 ""4(((/,,T22 ))$//>>>  w677777r*cd}|j||tj5|j|ddddS#1swxYwYdS)NrQrWrs r(*test_create_directory_already_exists_errorzAFakeFilesystemUnitTest.test_create_directory_already_exists_errors ""4(((  ! !%, / / - - O & &t , , , - - - - - - - - - - - - - - - - - -rZcd|j_d}|j|d|dz}tsT|t j5|j|ddddS#1swxYwYdS|j|||j |dS)NFrm perm_bitsr) rrHrIrr^r_EACCESrr0rr'rLrs r(7test_create_file_in_read_only_directory_raises_in_posixzNFakeFilesystemUnitTest.test_create_file_in_read_only_directory_raises_in_posix s(-% ""8u"===v% yy ?%%el33 7 7++I666 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 O ' ' 2 2 2 OODO229== > > > > >sBB  B cd|j_d}|j|d|dz}|j|||j|dS)NTz C:/foo/barr`rar)rrHrIrr0rrds r(;test_create_file_in_read_only_directory_possible_in_windowszRFakeFilesystemUnitTest.test_create_file_in_read_only_directory_possible_in_windowsst(,% ""8u"===v%  ##I... ..y99:::::r*cd}d}|j||||j|||jt j|d|z}||jt j|dS)Nr dummy datarz./%s)rrr0rrrrBdirname)r'rBrs r(%test_create_file_in_current_directoryz>>o%%i00 38,,, #,77777r*cTd}d}d}|jd|jd||j|||j|}|||j|||jdS)Nrrrrr)rrIrrlresolver5rrrs r(check_lresolve_objectz,FakeFilesystemUnitTest.check_lresolve_objects" ,  ""5))) ##L?#KKK &&y+>>>o&&y11 CH--- cl33333r*cFd|j_|dSr8rrHrr&s r(test_lresolve_object_windowsz3FakeFilesystemUnitTest.test_lresolve_object_windowss$(,% ""$$$$$r*cFd|j_|dSr4rr&s r(test_lresolve_object_posixz1FakeFilesystemUnitTest.test_lresolve_object_posixs$(-% ""$$$$$r*cX|jd||5|jddddn #1swxYwY||5|jdddddS#1swxYwYdS)N not_a_dirz not_a_dir/fooznot_a_dir/foo/bar)rrr^rr)r' error_subtypes r(check_directory_access_on_filez5FakeFilesystemUnitTest.check_directory_access_on_files& ##K000  ! !- 0 0 5 5 O # #O 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5  ! !- 0 0 : : O $ $%8 9 9 9 : : : : : : : : : : : : : : : : : :s#AAA7BB#&B#c\d|j_|tjdSr8)rrHrr_r'r&s r(%test_directory_access_on_file_windowszr@rCrErHrJrOrUrYr\r^rergrkrnrrrur}rrrrrrrrrrrrrrr*r(rrsa    ??? )))555@@@FFFEEE    WWWFFFEEEGGG FFF"OOO>>> <<< AAAFFF    LLL LLL 666    444777BBB&888--- 8 8 8--- ? ? ?;;;GGG 6 6 6666... + + +   +++666... === 8 8 8 4 4 4%%%%%%::::::;;;HHHHHr*rcVeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd S)!CaseInsensitiveFakeFilesystemTestctjd|_d|j_t j|j|_|jj|_dSNrrFrrris_case_sensitiverrrrBr&s r(r)z'CaseInsensitiveFakeFilesystemTest.setUpsD)8LLL,1)&t77GL r*c|jd|jd||jddSNrrPz /Foo/Bar/Baz)rrIrr0rJr&s r(test_get_objectz1CaseInsensitiveFakeFilesystemTest.test_get_objectsV "":... ##N333 22>BBCCCCCr*c|jd|jd|jd||jddSr)rrIrr*rrr&s r(test_remove_objectz4CaseInsensitiveFakeFilesystemTest.test_remove_objectsn "":... ##N333 %%n555 //??@@@@@r*c|jd||jd||jd|jd||jd||jddSN/Foo/Barrz /foo/Bar/bazz /Foo/bar/BAZrP)rrIr0rrr&s r( test_existsz-CaseInsensitiveFakeFilesystemTest.test_existss "":... ..z::;;; ..z::;;; ##N333 ..~>>??? ..~>>?????r*c|jd|jd|jd}|jd}|||dSNrrPr)rrIrJr5r'dir1dir2s r(.test_create_directory_with_different_case_rootzPCaseInsensitiveFakeFilesystemTest.test_create_directory_with_different_case_rootst "":... "">222))*55))*55 t$$$$$r*c|jd|jd|jd}|jd}|||dSr)rrIrrJr5rs r((test_create_file_with_different_case_dirzJCaseInsensitiveFakeFilesystemTest.test_create_file_with_different_case_dirst "":... ##N333))*55))*55 t$$$$$r*c|jd|jdd||jjd|jddS)Nz/foo/bazrz ./baz/bipz foo/baz/bipr)rrIrr5r@ resolve_pathr&s r(test_resolve_pathz3CaseInsensitiveFakeFilesystemTest.test_resolve_pathsv "":... &&z;??? , 9 9 9 O ( ( 4 4     r*c|jd||jd||jd||jd||jddSNrFooFoo/Bar)rrr0rBisdirrisfiler&s r(test_isdir_isfilez3CaseInsensitiveFakeFilesystemTest.test_isdir_isfiles ##I...  ../// ))%00111  ((33444 3344444r*cd}|j|d|d|jddS)NrQ1234567r FOO/BAR/BAZrrr5rBgetsizers r( test_getsizez.CaseInsensitiveFakeFilesystemTest.test_getsizesN!  ##I #BBB DI--m<<=====r*cNd|j_d}|j||dz}|dz}|j|||t j5|jj |ddddS#1swxYwYdS)NFrz/link) rrHrIrsymlinkr^r_ELOOPrBr)r'rL link_path link_targets r(!test_getsize_with_looping_symlinkzCCaseInsensitiveFakeFilesystemTest.test_getsize_with_looping_symlinks(-% ""8,,,w& ')   Y///  ! !%+ . . , , GL  + + + , , , , , , , , , , , , , , , , , ,s- BB!Bc|jd}d|_|d|jddSNz foo/bar1.txtz Foo/Bar1.TXT)rrrr5rBgetmtimer' test_files r(test_get_mtimez0CaseInsensitiveFakeFilesystemTest.test_get_mtimesKO//??   TY//??@@@@@r*c|jdd||jddS)Nrrrr)rrr0rJr&s r(test_get_object_with_file_sizez@CaseInsensitiveFakeFilesystemTest.test_get_object_with_file_sizesE ##J#;;; 22:>>?????r*N)rrrr)rrrrrrrrrrrrr*r(rrs!!! DDD AAA @@@%%%%%%   555>>> ,,,AAA @@@@@r*rcDeZdZdZdZdZdZdZdZdZ dZ d Z d S) CaseSensitiveFakeFilesystemTestctjd|_d|j_t j|j|_|jj|_dS)NrrTrr&s r(r)z%CaseSensitiveFakeFilesystemTest.setUpsD)8LLL,0)&t77GL r*c|jd|jd|t5|jdddddS#1swxYwYdSr)rrIrrXrLrJr&s r(rz/CaseSensitiveFakeFilesystemTest.test_get_object s "":... ##N333   w ' ' 7 7 O & &~ 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7sA77A;>A;c`|jd|jd|t5|jddddn #1swxYwY||jddSr)rrIrrXrLr*r0rr&s r(rz2CaseSensitiveFakeFilesystemTest.test_remove_objects "":... ##N333   w ' ' : : O ) ). 9 9 9 : : : : : : : : : : : : : : : ..~>>?????sA66A:=A:c|jd||jd||jd|jd||jd||jddSr)rrIr0rrrr&s r(rz+CaseSensitiveFakeFilesystemTest.test_existss "":... ..z::;;; // ;;<<< ##N333 //??@@@ //??@@@@@r*c|jd|jd|jd}|jd}|||dSr)rrIrJassertNotEqualrs r(rzNCaseSensitiveFakeFilesystemTest.test_create_directory_with_different_case_root st "":... "">222))*55))*55 D$'''''r*c|jd|jd|jd}|jd}|||dSr)rrIrrJrrs r(rzHCaseSensitiveFakeFilesystemTest.test_create_file_with_different_case_dir'st "":... ##N333))*55))*55 D$'''''r*c|jd||jd||jd||jd||jddSr)rrrrBrrr&s r(rz1CaseSensitiveFakeFilesystemTest.test_isdir_isfile.s ##I... //000 ))%00111 )))44555 3344444r*cd}|j|d|tj5|jdddddS#1swxYwYdS)NrQrrr)rrrXrerrorrBrrs r(rz,CaseSensitiveFakeFilesystemTest.test_getsize5s!  ##I #BBB   rx ( ( - - I  m , , , - - - - - - - - - - - - - - - - - -rc|jd}d|_|tj5|jdddddS#1swxYwYdSr)rrrr^r_r'rBrrs r(rz.CaseSensitiveFakeFilesystemTest.test_get_mtime;sO//??    ! !%, / / / / I  ~ . . . / / / / / / / / / / / / / / / / / /A))A-0A-N) rrrr)rrrrrrrrrr*r(rrs!!! 777 @@@AAA((((((555--- /////r*rc$eZdZdZdZdZdZdS)OsPathInjectionRegressionTestzTest faking os.path before calling os.walk. Found when investigating a problem with gws/tools/labrat/rat_utils_unittest, which was faking out os.path before calling os.walk. ctjd|_tj|_t j|j|_dSr)rrrrrBos_pathrrr&s r(r)z#OsPathInjectionRegressionTest.setUpJs:)8LLLw &t77r*c(|jt_dSr,)rrrBr&s r(r.z&OsPathInjectionRegressionTest.tearDownRs,r*cd}||j||j|||jd||j||jd|z|jd|z|jd|z|jd|z|jd|zddggfdd d ggfd gd gfd gd dgfg}t d|jdDd}| t|t|t||D]\}}| |d|d| |dt |d| |dt |ddS)Nz/xrz%s/poz %s/po/controlz%s/po/experimentz%s/gvz %s/gv/controlrgvpoz/x/gvcontrolz/x/po experimentcg|]}|Srr).0steps r( zQOsPathInjectionRegressionTest.test_create_top_level_directory..hs<<<$<<zOOsPathInjectionRegressionTest.test_create_top_level_directory..hs AaDr*)keyrrr) rrrrIr0rsortedrwalkr5lenzip)r' top_level_direxpectedresultentryexpected_entrys r(test_create_top_level_directoryz=OsPathInjectionRegressionTest.test_create_top_level_directoryUs<  // >>??? ""=111 ..s33444 ..}==>>> ""7]#:;;; ##Om$CDDD ##$6$FGGG ""7]#:;;; ##Om$CDDD3%  D$< $ b9+ & b9l3 4  <<$',,s*;*;<<<..QQQ XF 444%(%:%: B B !E>   ^A.a 9 9 9   ^A.uQx0@0@ A A A   ^A.uQx0@0@ A A A A B Br*N)rrr__doc__r)r.rrr*r(rrBsP888BBBBBr*rceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zejejd kddZdZdZdZdZdZdZdZdZdZejejpejddZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2d-S).FakePathModuleTestctjd|_tj|j|_|jj|_dSN!r)rrrrrrrBr&s r(r)zFakePathModuleTest.setUpqs:)8LLL&t77GL r*c||j_d}|jj|z}|j||||j||||j||||jd|zdS)Nrz..!%s)rrHr@rr5rBabspathr' is_windowsfilenamers r( check_abspathz FakePathModuleTest.check_abspathvs(2%//(: ##G,,, $)"3"3G"<"<=== $)"3"3H"="=>>> $)"3"3Gh4F"G"GHHHHHr*c2|ddSNTr r"r&s r(test_abspath_windowsz'FakePathModuleTest.test_abspath_windowss d+++++r*c2|ddS)>> !2!2:!>!>??? ty0099::: $)"3"3K"@"@AAA  1 1( ; ;<<<  1 1) < <=====r*cld}|||jd|zdS)NrUz%s!baz)r5rBrj)r'rjs r( test_dirnamezFakePathModuleTest.test_dirnames8 $)"3"3Hw4F"G"GHHHHHr*cTgd}|d|jj|dS)N)rrrr]r5rBr:r' componentss r(test_join_stringsz$FakePathModuleTest.test_join_strings s4***    (CDDDDDr*cTgd}|d|jj|dS)N)r,barbazr^ryrzs r(test_join_bytesz"FakePathModuleTest.test_join_bytes$s4---  )DEEEEEr*c`|jrT||jd|jjddddS||jd|jjddddS)N~ USERPROFILE\rHOMEr)r r5rB expanduserrenvironreplacer&s r(test_expand_userz#FakePathModuleTest.test_expand_user(s ?     $$S)) .66tSAA         $$S))'//S99     r*zonly tested on unix systemsctjdkrd}nd}||jd|dS)Ndarwinz !var!rootz!rootz~root)sysplatformr5rBr)r'roothomes r(test_expand_rootz#FakePathModuleTest.test_expand_root4sI <8 # #"HHH --g66AAAAAr*cd}|tj5|j|ddddS#1swxYwYdS)Nr])rXrrrBrrs r(test_getsize_path_nonexistentz0FakePathModuleTest.test_getsize_path_nonexistent?s!   rx ( ( ) ) I  i ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )sA  AAcd}|j||d|j|dS)Nr]rrrs r(test_getsize_file_emptyz*FakePathModuleTest.test_getsize_file_emptyDsI!  ##I... DI--i8899999r*cd}d}|j|d|d|j||d|j|dS)Nr]r^rrrrr_s r(test_getsize_file_non_zero_sizez2FakePathModuleTest.test_getsize_file_non_zero_sizeIsy! ( ##I #BBB DI--i88999 DI--o>>?????r*cd}|j||j|}|t |dkd|zdS)NrUr&expected non-negative size; actual: %s)rrIrBrrintr'rLras r(test_getsize_dir_emptyz)FakePathModuleTest.test_getsize_dir_emptyPs_ ""8,,,y  ** TQ(PSW(WXXXXXr*cd}|j|j|d|j|}|t |dkd|zdS)NrUrrr)rrr;rBrrrrs r(test_getsize_dir_non_zero_sizez1FakePathModuleTest.test_getsize_dir_non_zero_sizeWsq ##DO$=$=h$N$NOOOy  ** TQ(PSW(WXXXXXr*c|jd||jd||jd||jd||jddS)NrUrr, it_dont_exist)rrr0rBrrr&s r( test_isdirzFakePathModuleTest.test_isdir^s ##I...  ..///  //000 33444 99:::::r*c|jd||jd||jd||jd||jd|jjd|j_||jd||jd||jddS)Nr5rorArrUr)rrr0rBrr@rr&s r(test_isdir_with_cwd_changez-FakePathModuleTest.test_isdir_with_cwd_changees ##N333  //000   33444  ..///   22333!%!>CCC  //000   33444  ../////r*c|jd||jd||jd||jd||jddS)NrUrfoo!barr)rrrrBrr0r&s r( test_isfilezFakePathModuleTest.test_isfileps ##I... ))%00111  ((33444  ((44555 ))/::;;;;;r*c\|jd}|d|jdd|_|d|jd|d|jddS)Nz foo!bar1.txtrs foo!bar1.txt)rrrrBrrr5rs r(rz!FakePathModuleTest.test_get_mtimewsO//??  B 2 2> B BCCC  TY//??@@@ TY//@@AAAAAr*c||jd|tj5|jdddddS#1swxYwYdS)Ndoes_not_exist)rrBrr^r_r'rr&s r(test_get_mtime_raises_os_errorz1FakePathModuleTest.test_get_mtime_raises_os_error~s ))*:;;<<<  ! !%, / / 1 1 I  / 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1s A55A9<A9ct|jd|jd|jdd||jd||jd||jd||jd||jd||jd||jd||jddS)Nrzfoo!regular_filezfoo!link_to_file regular_filesfoo!link_to_filer) rrIrrrrBislinkr0rr&s r( test_islinkzFakePathModuleTest.test_islinksl ""5))) ##$6777 &&'9>JJJ ))%00111  (();<<===  (();<<===  (()<==>>>  (()<==>>>  (();<<=== ))*<==>>> ))/::;;;;;r*cd|j_|jd|jdd||jddS)NFrrUzfoo!Bar)rrrIrr0rBrr&s r(test_is_link_case_sensitivez.FakePathModuleTest.test_is_link_case_sensitivesb,1) ""5))) &&y%888  ((3344444r*c||jd||jd||jd||jd|jd||jd||jd||jddS)NrjrrD!mount!!mounts!mount)rrBismountr0rrdr&s r( test_ismountzFakePathModuleTest.test_ismounts **2..///  ))#..///  ))$//000 **955666 ''111  ))(33444  )))44555  )))4455555r*cnd|j_||jd||jd||jd||jd|jd||jd||jddS)NTrc:!c:zz:!rr)rrHr0rBrrrdr&s r(test_ismount_with_drive_lettersz2FakePathModuleTest.test_ismount_with_drive_letterss(,%  ))#..///  ))%00111 **400111  ))%00111 ''111  ))(33444  )))4455555r*cd|j_||jd||jd||jd||jd||jddS)NTz!!a!z!!a!bz!!a!b!z!a!b!z!!a!b!c)rrHr0rBrrr&s r(test_ismount_with_unc_pathsz.FakePathModuleTest.test_ismount_with_unc_pathss(,%  ))&11222  ))'22333  ))(33444 **733444 **95566666r*cd|j_|jd||jd||jd||jdd|j_||jddS)Nrrrz!mount!!TzZ:!)ralternative_path_separatorrdr0rBrrHr&s r(*test_ismount_with_alternate_path_separatorz=FakePathModuleTest.test_ismount_with_alternate_path_separators582 ''111  ))(33444  )))44555  ))*55666(,%  ))%0011111r*c:|t|jddd}tjdkr |jrd}nd}|r)|t|j|d|t|jddS) z(Forwards any non-faked calls to os.path.r8zGet a faked os.path functionN)rRrq _get_bothseps_join_real_pathz;Get a real os.path function not implemented in fake os.path nonexistent)r0hasattrrBr version_infor r)r'private_path_functions r($test_getattr_forward_to_real_os_pathz7FakePathModuleTest.test_getattr_forward_to_real_os_paths  5113QRRR $  f $ $ :(7%%(9%   OO #899P    M::;;;;;r*c2d|j_|d|jd|d|jd|d|jddS)NF)rjrjrUrU)rjrrUrA)rj!!zfoo!!bar !!foo!!bar)rrHr5 splitrootr&s r(test_splitroot_posixz'FakePathModuleTest.test_splitroot_posixs(-% ,do.G.G .R.RSSS -t/H/H/T/TUUU  "DO$=$=l$K$K     r*N)3rrrr)r"r'r*r.r1r3r=rBrFrMrQunittestskipIfrrrVr[rrerirurwr|rrr r  is_cygwinrrrrrrrrrrrrrrrrrrrrr*r(rrps!!! III,,,---HHH222333   (FFF / / / E E E W W WX_S%/1NOO   PO  WWWEEE333 5 5 5>>>IIIEEEFFF   X_1x1%BB B))) ::: @@@YYYYYY;;; 0 0 0<<<BBB111 <<<$555666666777222<<<      r*rceZdZdZdS)PathManipulationTestBasec:tjd|_dS)N|rrrrr&s r(r)zPathManipulationTestBase.setUps)8LLLr*N)rrrr)rr*r(rrs(MMMMMr*rcTeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd S)CollapsePathPipeSeparatorTestzKTests CollapsePath (mimics os.path.normpath) using | as path separator.cb|d|jddS)Nrrjr5rnormpathr&s r( test_empty_path_becomes_dot_pathz>CollapsePathPipeSeparatorTest.test_empty_path_becomes_dot_paths. do66r::;;;;;r*cb|d|jddSrrr&s r(test_dot_path_unchangedz5CollapsePathPipeSeparatorTest.test_dot_path_unchanged. do66s;;<<<<%>t%D%DEEEEEr*cb|d|jddS)zMTests that '/' is not treated specially if the path separator is '|'.)rja/brNrr&s r(test_slashes_do_not_splitz'SplitPathTest.test_slashes_do_not_splits0 do&?&?&F&FGGGGGr*c|d|jd|d|jd|d|jd|d|jd|d|jd dS) N)rwba|bza|||b)|ar|a||b)rca|b|c)z|a|brz|a|b|crr&s r(,test_eliminate_trailing_separators_from_headz:SplitPathTest.test_eliminate_trailing_separators_from_heads T_%>%>u%E%EFFF T_%>%>w%G%GHHH do&?&?&H&HIII t'@'@'I'IJJJ (A(A((K(KLLLLLr*c|d|jd|d|jd|d|jddS)N)|||rjr)rrwr)rrwz|||arr&s r(#test_root_separator_is_not_strippedz1SplitPathTest.test_root_separator_is_not_stripped&sz do&?&?&F&FGGG T_%>%>t%D%DEEE t'@'@'H'HIIIIIr*cb|d|jddS)N)rrja|b|rr&s r()test_empty_tail_if_path_ends_in_separatorz7SplitPathTest.test_empty_tail_if_path_ends_in_separator+s. do&?&?&G&GHHHHHr*cb|d|jddS)N)rrz|a||b||crr&s r(0test_empty_path_components_are_preserved_in_headz>SplitPathTest.test_empty_path_components_are_preserved_in_head.s. )B)B:)N)NOOOOOr*N) rrrrrrrrrrrrr*r(rrs""BBBFFFHHH MMMJJJ IIIPPPPPr*rcHeZdZdZdZdZdZdZdZdZ dZ d Z d Z d S) JoinPathTestzETests JoinPath (which mimics os.path.join) using | as path separator.cb|d|jddSrr5rr;r&s r(test_one_empty_componentz%JoinPathTest.test_one_empty_component5s. T_66r::;;;;;r*cf|d|jddddSrr r&s r(test_multiple_empty_componentsz+JoinPathTest.test_multiple_empty_components8s2 T_66r2rBBCCCCCr*cb|d|jddS)Nz||a||r r&s r(2test_separators_not_stripped_from_single_componentz?JoinPathTest.test_separators_not_stripped_from_single_component;s. $/";";G"D"DEEEEEr*c h|d|jdddddS)Nza|b|c|drwrrdr r&s r(+test_one_separator_added_between_componentsz8JoinPathTest.test_one_separator_added_between_components>s4 DO$=$=c3S$Q$QRRRRRr*c|d|jddd|d|jddddS)Nra|b|rz a|||b|||cza|||zb|||r r&s r(:test_no_separator_added_for_components_ending_in_separatorzGJoinPathTest.test_no_separator_added_for_components_ending_in_separatorAs] $/";";D$"L"LMMM do&?&?PS&T&TUUUUUr*c h|d|jdddddS)Nz|c|drwz|bz|crr r&s r(8test_components_preceding_absolute_component_are_ignoredzEJoinPathTest.test_components_preceding_absolute_component_are_ignoredEs4 !:!:3dC!P!PQQQQQr*c|d|jdd|d|jddddS)Nrrwrjr r&s r(6test_one_separator_added_for_trailing_empty_componentszCJoinPathTest.test_one_separator_added_for_trailing_empty_componentsHsZ t88bAABBB t88b"EEFFFFFr*cd|d|jdddS)Nrwrjr r&s r(4test_no_separator_added_for_leading_empty_componentszAJoinPathTest.test_no_separator_added_for_leading_empty_componentsLs0 do77C@@AAAAAr*c|d|jddd|d|jddddS)Nrrwrjrrrrr r&s r(&test_internal_empty_components_ignoredz3JoinPathTest.test_internal_empty_components_ignoredOs\  9 9#r3 G GHHH !:!:4T!J!JKKKKKr*N) rrrrr rrrrrrrr rr*r(r r 2sOO<<<DDDFFFSSSVVVRRRGGGBBBLLLLLr*r ceZdZdZdS)PathSeparatorTestctjd}tj|}|d|j|d|jjdSr)rrrrr5r8rB)r'rrs r(2test_os_path_sep_matches_fake_filesystem_separatorzDPathSeparatorTest.test_os_path_sep_matches_fake_filesystem_separatorUs`$33GGG  -j99 n0111 n1566666r*N)rrrr$rr*r(r"r"Ts#77777r*r"cfeZdZdZdZdZdZeje j ddZ dS)NormalizeCaseTestcRtjd|_d|j_dSr)rrrrr&s r(r)zNormalizeCaseTest.setUp]s')8LLL,1)))r*c&|jd||jjd|jd||jjd|jddS)Nrrrz/FOO/BAR)rrr5r@_original_pathr&s r(test_normalize_casez%NormalizeCaseTest.test_normalize_caseas ##J/// , 5 5 5 O * *: 6 6    , 5 5 5 O * *: 6 6     r*c d|j_|jd|d|jd|d|jddS)NTz C:/Foo/Barz c:/foo/barz C:/FOO/BAR)rrHrr5r)r&s r(test_normalize_case_for_drivez/NormalizeCaseTest.test_normalize_case_for_drivelst(,% ##L111 t'E'El'S'STTT t'E'El'S'STTTTTr*c&|jd||jjd|jd||jjd|jddS)Nrz Foo/Bar/bazrPz Foo/Bar/BAZz /FOO/BAR/BAZ)rrIr5r@r)r&s r()test_normalize_case_for_non_existing_filez;NormalizeCaseTest.test_normalize_case_for_non_existing_filers "":... , 9 9 9 O * *> : :    , 9 9 9 O * *> : :     r*z(Regression test for Windows problem onlyctj}tjtjtjtd}||tj |d}| || | dS)Nr __init__.py) rrrrBr7rjr__file__add_real_directoryr:r5r)upper)r'r real_dir_path initPyPaths r(/test_normalize_case_for_lazily_added_empty_filezANormalizeCaseTest.test_normalize_case_for_lazily_added_empty_file}s %355  bgoobgooh6O6O&P&PQQRST %%m444W\\-??  Z%>%>z?O?O?Q?Q%R%RSSSSSr*N) rrrr)r*r,r.rrr r r6rr*r(r&r&\s222    UUU    X_  !KTTTTTr*r&c2eZdZdZdZdZdZdZdZdS)AlternativePathSeparatorTestcRtjd|_d|j_dS)Nrr?)rrrrr&s r(r)z"AlternativePathSeparatorTest.setUps')8LLL58222r*ctj}|jr|d|jn||jtjd}||jdSr)rrr r5r assertIsNoners r(test_initial_valuez/AlternativePathSeparatorTest.test_initial_values~$355 ? E   S*"G H H H H   jC D D D$33GGG  *?@@@@@r*ctj|j}|d|j|d|jjdS)Nr:)rrrr5altseprB)r'rs r( test_alt_sepz)AlternativePathSeparatorTest.test_alt_sepsO -do>> n3444 n1899999r*cb|d|jddS)NrAz !foo??barrr&s r((test_collapse_path_with_mixed_separatorszEAlternativePathSeparatorTest.test_collapse_path_with_mixed_separatorss. T_%=%=k%J%JKKKKKr*cd}||jjd|j|dS)Nz foo?..?barrrrs r()test_normalize_path_with_mixed_separatorszFAlternativePathSeparatorTest.test_normalize_path_with_mixed_separatorssM , 1 1 1 O ' ' - -     r*c"|jd|jd||jd||jddS)Nz ?foo?bar?bazz!foo!bar!xyzzy!plughr5z?foo?bar?xyzzy?plugh)rrr0rr&s r(!test_exists_with_mixed_separatorsz>AlternativePathSeparatorTest.test_exists_with_mixed_separatorssz ##N333 ##$:;;; ..~>>??? ../EFFGGGGGr*N) rrrr)r=r@rBrDrFrr*r(r8r8sy999AAA::: LLL   HHHHHr*r8ceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdS)DriveLetterSupportTestcjtjd|_d|j_d|j_dS)Nrr^T)rrrrrHr&s r(r)zDriveLetterSupportTest.setUps1)8LLL582(,%%%r*ctj}|jr||jdS||jdSr,)rrr r0rHrrs r(r=z)DriveLetterSupportTest.test_initial_valuesR$355 ? 7 OOJ4 5 5 5 5 5   Z5 6 6 6 6 6r*cb|d|jddS)Nrlz c:!!foo!!barrr&s r(test_collapse_pathz)DriveLetterSupportTest.test_collapse_paths. t'?'?'O'OPPPPPr*cb|d|jddS)N !!foo!bar!bazz!!foo!bar!!baz!!rr&s r(test_collapse_unc_pathz-DriveLetterSupportTest.test_collapse_unc_paths/ $/*B*BCU*V*VWWWWWr*cd|j_|d|jdd|j_|d|jddS)Nrjrlz c:!foo!!barrkrrr&s r(test_normalize_path_strz.DriveLetterSupportTest.test_normalize_path_strsh  t'B'B='Q'QRRR& t'B'B5'I'IJJJJJr*cd|j_|d|jdd|j_|d|jddS)Nr* c:!foo!bars c:!foo!!barrnr~rr&s r(test_normalize_path_bytesz0DriveLetterSupportTest.test_normalize_path_bytessh! (C(CN(S(STTT' (C(CF(K(KLLLLLr*c|d|jd|d|jd|d|jd|d|jd|d |jd |d |jd |d |jddS)N)rkrrl)rrrk)rorrA)rrro)rqrrr)rrrq)rrrUrr&s r(test_split_path_strz*DriveLetterSupportTest.test_split_path_strs *DO,E,El,S,STTT )B)B8)L)LMMM $/*C*CJ*O*OPPP t'@'@'H'HIII )4?+D+D[+Q+QRRR (A(A'(J(JKKK )B)B9)M)MNNNNNr*c.|d|jd|d|jd|d|jd|d|jd|d|jd |d|jd dS) N)za^brza^b^c)za^b!crza^b!c^dza^b!c!d)sa^bcsa^b^c)sa^b!cdsa^b!c^dsa^b!c!drr&s r(test_split_with_alt_separatorz4DriveLetterSupportTest.test_split_with_alt_separators t'@'@'I'IJJJ )B)B9)M)MNNN )B)B9)M)MNNN )B)B8)L)LMMM )4?+D+DZ+P+PQQQ )4?+D+DZ+P+PQQQQQr*c|d|jd|d|jd|d|jd|d|jd|d |jd |d |jd |d |jddS)N)rnr~rT)rmr,rn)rpr~!foo!bar)rDr,rp)rtr~s c:foo!bar)rsr,rt)r,r~rrr&s r(test_split_path_bytesz,DriveLetterSupportTest.test_split_path_bytess ,do.G.G .V.VWWW )4?+D+DY+O+OPPP *DO,E,Ek,R,RSSS )B)B7)K)KLLL +T_-F-F|-T-TUUU $/*C*CH*M*MNNN )4?+D+DZ+P+PQQQQQr*cf|d|jddddS)Nzc:drrrr r&s r(1test_characters_before_root_ignored_in_join_pathszHDriveLetterSupportTest.test_characters_before_root_ignored_in_join_pathss2  9 9#tS I IJJJJJr*cb|d|jddS)Nr@)r5rrr&s r(rz(DriveLetterSupportTest.test_resolve_paths. t'C'CL'Q'QRRRRRr*c|gd|jd|dg|jddS)N)rrrrlrrr&s r(test_get_path_componentsz/DriveLetterSupportTest.test_get_path_componentssf  O , ,\ : :    $!A!A$!G!GHHHHHr*cv|d|jd|d|jd|d|jd|d|jddS) N)rrArl)rjrArA)rrUrr)rjrUrUr5r splitdriver&s r(test_split_drive_strz+DriveLetterSupportTest.test_split_drive_strs +T_-G-G -U-UVVV )4?+E+Ej+Q+QRRR *DO,F,F{,S,STTT $/*D*DY*O*OPPPPPr*c|d|jd|d|jddS)N)rsr]rT)r*r]r]rer&s r(test_split_drive_bytesz-DriveLetterSupportTest.test_split_drive_bytess^  $/"<"<]"K"K    +T_-G-G -T-TUUUUUr*c.|d|jd|d|jd|d|jd|d|jd|d |jd |d |jd dS) N)rz^foo^barz c:^foo^bar)rjfoo^barrk)rj foo^bar!bazrl)rs^foo^bars c:^foo^bar)r*rmrm)r* ^foo^bar!bazrnrer&s r(test_split_drive_alt_sepz/DriveLetterSupportTest.test_split_drive_alt_seps +T_-G-G -U-UVVV $/*D*DY*O*OPPP ,do.H.H.W.WXXX  $/"<"<]"K"K    +T_-G-G -T-TUUU  "DO$>$>$O$O     r*cv|d|jd|d|jd|d|jd|d|jddS) N) !!foo!bar!bazrO)rj!!foors)rjrr)rqr !!foo!bar!!rer&s r(test_split_drive_with_unc_pathz5DriveLetterSupportTest.test_split_drive_with_unc_path   !4?#=#=o#N#N    (B(B7(K(KLLL +T_-G-G -U-UVVV ,do.H.H.W.WXXXXXr*cv|d|jd|d|jd|d|jd|d|jddS) N) ^^foo^barrrz ^^foo^bar!baz)rj^^foory)rj ^^foo^^barrz)rxz^^ ^^foo^bar^^rer&s r(&test_split_drive_with_unc_path_alt_sepz=DriveLetterSupportTest.test_split_drive_with_unc_path_alt_seprvr*c|d|jd|d|jd|d|jd|d|jd|d |jd dS) N)d:!foor d:!foo!baz)rrjz d:!foo!baz!rrjr)rrjr)c:!!rjrrr&s r(test_split_path_with_drivez1DriveLetterSupportTest.test_split_path_with_drive *DO,E,El,S,STTT +T_-F-F}-U-UVVV T_%>%>t%D%DEEE do&?&?&F&FGGG t'@'@'H'HIIIIIr*c|d|jd|d|jd|d|jd|d|jd|d |jd dS) N)zd:^foor d:^foo^baz)rrjz d:^foo^baz^rr)c:^rjr)c:^^rjrrr&s r("test_split_path_with_drive_alt_sepz9DriveLetterSupportTest.test_split_path_with_drive_alt_sep#rr*c|d|jd|d|jd|d|jddS)N) !!foo!bar!rrO)rqrjrq)rtrjrtrr&s r(test_split_path_with_unc_pathz4DriveLetterSupportTest.test_split_path_with_unc_path*  !4?#<#<_#M#M    *DO,E,Ek,R,RSSS ,do.G.G .V.VWWWWWr*c|d|jd|d|jd|d|jddS)N)z ^^foo^bar^r ^^foo^bar^baz)rxrjrx)r{rjr{rr&s r(%test_split_path_with_unc_path_alt_sepz.create_too_large_fileis=#.. 3$ 3*q.1222 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3sAAArrrrw) rrdrXrLr5get_disk_usageusedrr)r'rrrs` @r( test_disk_usage_on_file_creationz.DiskSpaceTest.test_disk_usage_on_file_creationes  *555 3 3 3 3 3 3  w ' ' $ $ ! ! # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ DG228<<ABBB YY}c * * )d JJsZ' ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) TW%;%;H%E%E%JKKKKKs$ AAA+CCCcpd|j_|jd|jdd|d|jdjd |j_|d|jd jdS) NTrrrArrrzD:!zE:!fooro)rrHresetrr5rrrr&s r($test_disk_usage_on_automounted_drivez2DiskSpaceTest.test_disk_usage_on_automounted_drivews $   %%% J333 DG22599>???  DG226::?@@@@@r*c|jdd|jdd|jdd|jd d |jd d |d|jd j|d |jdj|d |jdj|d|jdjdS)NrorrrAirrrr!foo!bazrr5rr)rrdrr5rrtotalr&s r( test_disk_usage_on_mounted_pathsz.DiskSpaceTest.test_disk_usage_on_mounted_pathss3 3777  s;;; FB/// J333 NC888 TW33C88=>>> TW33F;;@AAA dg44Z@@EFFF dg44Z@@FGGGGGr*ctjdd}|dd|d|dS)Nrdrr r)rrlZ)rrrr5rrs r(/test_file_system_size_after_large_file_creationz=DiskSpaceTest.test_file_system_size_after_large_file_creationss$3+C    z3JKKK    % % ' '      r*c|jdd|d|jdS)NrAxyzzyr)r_rrr5rr&s r(0test_file_system_size_after_binary_file_creationz>DiskSpaceTest.test_file_system_size_after_binary_file_creationsG J::: tw'='='?'?@@@@@r*c|jdd|d|jdS)NrA complicatedr)r Yrr&s r(6test_file_system_size_after_ascii_string_file_creationzDDiskSpaceTest.test_file_system_size_after_ascii_string_file_creationsG J??? (>(>(@(@AAAAAr*c|jddd|d|jdS)NrAu сложноutf-8rencoding)r Xrr&s r(6test_filesystem_size_after_2byte_unicode_file_creationzDDiskSpaceTest.test_filesystem_size_after_2byte_unicode_file_creationsI J'RRR (>(>(@(@AAAAAr*c|jddd|d|jdS)NrAu複雑rr)rrq^rr&s r(6test_filesystem_size_after_3byte_unicode_file_creationzDDiskSpaceTest.test_filesystem_size_after_3byte_unicode_file_creationsI JGLLL tw'='='?'?@@@@@r*c|jdd|jdd|jd|d|jdS)NrArrrrr)rrPrrr*r5rr&s r()test_file_system_size_after_file_deletionz7DiskSpaceTest.test_file_system_size_after_file_deletionsx J::: J333 j))) (>(>(@(@AAAAAr*c<|jdd|jdd|jdd|jd|d |jdS) NrArrrr !foo1!barrro)rrrrr&s r(-test_file_system_size_after_directory_removalz;DiskSpaceTest.test_file_system_size_after_directory_removals J333 J333 K444 f%%% (>(>(@(@AAAAAr*c2|j} |jddn%#t$r|dYnwxYw||jdz|jjdS)NrAdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar@File with contents fitting into disk space could not be written.rrrrrLfailr5rr' initial_usages r('test_creating_file_with_fitting_contentz5DiskSpaceTest.test_creating_file_with_fitting_contents..00   G   Z  @ @ @ @    IIU       +c1473I3I3K3K3PQQQQQ8AAcfd}j}t5|dddn #1swxYwY|jdS)Nc@jdddS)NrAseaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarrrr&sr(create_large_filezRDiskSpaceTest.test_creating_file_with_content_too_large..create_large_files$ G   Z  @ @ @ @ @r*rrrXrLr5)r'rrs` r()test_creating_file_with_content_too_largez7DiskSpaceTest.test_creating_file_with_content_too_larges A A A A A..00   w ' '                      (>(>(@(@AAAAA AAAc2|j} |jddn%#t$r|dYnwxYw||jdz|jjdS)NrArrz.create_large_files$ G   C  8 8 8 8 8r*r)r'rrs` r(&test_creating_file_with_size_too_largez4DiskSpaceTest.test_creating_file_with_size_too_larges..00  9 9 9 9 9  w ' '                      (>(>(@(@AAAAArc|jdd} |d|ddS#t$r|dYdSwxYw)NrArrrrz8Resizing file failed although disk space was sufficient.)rrrryrLrr' file_objects r("test_resize_file_with_fitting_sizez0DiskSpaceTest.test_resize_file_with_fitting_sizesg))*b)AA  R  + +C 0 0 0  $ $Z 0 0 0 0 0 R R R IIP Q Q Q Q Q Q Rs*A A-,A-cp|jdd}|tj5|ddddn #1swxYwY|tj5|dddddS#1swxYwYdS)NrArrrږaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)rrr^r_r`rryrs r($test_resize_file_with_size_too_largez2DiskSpaceTest.test_resize_file_with_size_too_larges)g))*b)AA  ! !%, / / 1 1  + +C 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1  ! !%, / / 0 0  $ $Y / / / 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0s#AA"%A"B++B/2B/c|jdd|jdd|d|jjdS)NrArrrorrrrrrenamer5rrr&s r(,test_file_system_size_after_directory_renamez:DiskSpaceTest.test_file_system_size_after_directory_renames` J333 vv&&& TW3355:;;;;;r*c|jdd|jdd|d|jjdS)NrArrrrr&s r('test_file_system_size_after_file_renamez5DiskSpaceTest.test_file_system_size_after_file_renames` J333 z:... TW3355:;;;;;r*ctd}d}|j|d|d|jj|j|||d|jj|j||d|jj|j||d|jjdS)N test_file1 test_file2rrr)rrr5rrrlinkunlink)r' file1_path file2_paths r(-test_that_hard_link_does_not_change_used_sizez;DiskSpaceTest.test_that_hard_link_does_not_change_used_sizes ! !  J333 TW3355:;;;  Z,,, TW3355:;;; z""" TW3355:;;; z""" DG22449:::::r*c|jdd|jd|tj5|jdddddn #1swxYwY|tj5|jdd dddn #1swxYwY |jd d|jdd |jd d dS#t $r|dYdSwxYw)Nz!mount_limitedrrz!mount_unlimitedz!mount_limited!foorr!barrrorz!mount_unlimited!fooi@Br)rrdr^r_r`rrLrr&s r(1test_that_the_size_of_correct_mount_point_is_usedz?DiskSpaceTest.test_that_the_size_of_correct_mount_point_is_used s  0R@@@  2333  ! !%, / / B B G   4b  A A A B B B B B B B B B B B B B B B  ! !%, / / 5 5 G    4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5  G    3 3 3 G   4b  A A A G   6  H H H H H    IIU       s7A??BB)CCCAD44EEcP|jdd|jdd|jdd|jd d|jd d|d |jd j|d|jd j|d|jdjdS)N!mount1rrz!mount1!bar!mount2rrArrz!mount1!foo!barz!mount1!bar!mount2!foo!barrro !mount1!foor)rrdrr5rfreer&s r(3test_that_disk_usage_of_correct_mount_point_is_usedzADiskSpaceTest.test_that_disk_usage_of_correct_mount_point_is_useds  b999  4DDD J333 -r::: 8"EEE TW33F;;@AAA TW33MBBGHHH TW334HIINOOOOOr*c|jdd|tj5|jdddddn #1swxYwY|jdd|jdd|d|jdj dS) NrrrrrrrrrB) rrdr^r_r`rset_disk_usager5rrr&s r(test_set_larger_disk_sizez'DiskSpaceTest.test_set_larger_disk_size's  b999  ! !%, / / < < G   s  ; ; ; < < < < < < < < < < < < < < < #I>>> M3777 dg44]CCHIIIIIsA%%A),A)c|jdd|jdd|tj5|jdddddn #1swxYwY|jd d|d|jdj dS) Nrrrrrrrr) rrdrr^r_r`rr5rrr&s r(test_set_smaller_disk_sizez(DiskSpaceTest.test_set_smaller_disk_size/s  c::: M3777  ! !%, / / B B G " "by " A A A B B B B B B B B B B B B B B B #I>>> TW33MBBGHHHHHsBBBc|jd|jdd|jdd|d|jdjdS)Nrrrrr)rrdrrr5rrr&s r( test_disk_size_on_unlimited_diskz.DiskSpaceTest.test_disk_size_on_unlimited_disk7s}  *** M3777 $Y??? dg44]CCHIIIIIr*cd|j_|jdd|jdd||jdjd dS) NT d:!foo!barrrr d:rr~r )rrHrrr5rrr&s r(5test_disk_size_on_auto_mounted_drive_on_file_creationzCDiskSpaceTest.test_disk_size_on_auto_mounted_drive_on_file_creation=sq $ L#666 $T::: //99>DDDDDr*c`d|j_|jd|jdd|jdd|jdd |d |jd jdS) NTrzd:!foo!bar!bazrrrr rri r~)rrHrIrrr5rrr&s r(:test_disk_size_on_auto_mounted_drive_on_directory_creationzHDiskSpaceTest.test_disk_size_on_auto_mounted_drive_on_directory_creationDs $ <((( ,c::: L#666 $T::: dg44X>>CDDDDDr*c|jdd}|jd}||j||j|jdS)Nrs somebytesrr)rrryrr5)r' source_file dest_files r($test_copying_preserves_byte_contentsz2DiskSpaceTest.test_copying_preserves_byte_contentsLsjg))%,)GG G''.. {3444 +[-ABBBBBr*c|dd5}|d|dddn #1swxYwY|d|jddS)Nbar.txtrD' D>'D+ +D>.D+ /D>2 E>E EE EEE5)F++F/2F/c|dd5}|ddddn #1swxYwY|d5}||ddddn #1swxYwY|t j5|dd5}|d|d|t j5|dddn #1swxYwYdddn #1swxYwYdddn #1swxYwY|d5}||dddddS#1swxYwYdS)Nrrrzr+r >ED> E E(E E(E E((E,/E,)F>>GGN)#rrrr)rrrrrrrrrrrrrrrrrrrrrrr rrrrrr"r%r)rr*r(rr_s3444 LLL$AAA H H H    AAABBBBBBAAABBB BBB R R R B B BRRR B B BRRR000<<< <<< ; ; ;$ P P PJJJIIIJJJ EEEEEECCC ::: + + + 1 1 1 1 1 1 1 1r*rcDeZdZdZdZdZdZdZdZdZ dZ d Z d S) MountPointTestc<tjdd|_dSrrr&s r(r)zMountPointTest.setUps$)83   r*c|jd|jd|jddS)Nrorr)rrdr&s r(add_mount_pointszMountPointTest.add_mount_pointssJ ''/// ''/// '' 33333r*c||d|jdj|d|jdj|d|jdj|d|jdjdS) NrrrrorRrr)r.r5rrJst_devr&s r(0test_that_new_mount_points_get_new_device_numberz?MountPointTest.test_that_new_mount_points_get_new_device_numbers  DO66s;;BCCC DO66v>>EFFF DO66v>>EFFF DO66zBBIJJJJJr*c`||d|jdj|d|jdj|d|jdjdSNrrrrAr0z!foo!baz!foo!bar)r.r5rrIr1r&s r(3test_that_new_directories_get_correct_device_numberzBMountPointTest.test_that_new_directories_get_correct_device_numbers  DO66{CCJKKK DO66zBBIJJJ DO667IJJQRRRRRr*c`||d|jdj|d|jdj|d|jdjdSr4)r.r5rrr1r&s r(-test_that_new_files_get_correct_device_numberzr@rr*r(r+r+s   444 KKKSSS TTT 555 M M M M M MTTTTTr*r+ceZdZdZdZdS)ConvenienceMethodTestc||d}|dd}|j|d||j|jd|j||||j|jd| |j |dS)Nrrrz link testrrr) skip_if_symlink_not_supported make_pathrrr5rr1st_nlink create_linkr0rr'rrs r()test_create_link_with_non_existent_parentz?ConvenienceMethodTest.test_create_link_with_non_existent_parents **,,,^^L11 NN=,??  ##J#EEE j11:A>>> ##J ::: j11:A>>> ..y99:::::r*c||d}|dd}|j|d|j||||j|||j|dS)Nrrrz symlink testr)rDrErrrr0rrrHs r(,test_create_symlink_with_non_existent_parentzBConvenienceMethodTest.test_create_symlink_with_non_existent_parents **,,,^^L11 NN=,??  ##J#HHH &&y*=== ..y99::: ..y99:::::r*N)rrrrIrKrr*r(rBrBs2 ; ; ;;;;;;r*rBceZdZdZdZdZdZdZddZdZ d Z d Z d Z d Z d ZdZdZdZejdZdZdZdZdZdZdZdZdZdZdZdZdS)RealFileSystemAccessTestctj|_tj|j|_t jt jt j td|_ t j|j d|_ dSr ) rrrrrrrBr7rjrr1 pyfakefs_path root_pathr&s r(r)zRealFileSystemAccessTest.setUps)8::(5doFFW]]27??27??8;T;T+U+UVV  t'9::1=r*c8tjdd}|t5|j|dddn #1swxYwY||j|dS)N nonexistingztest.txt) rrBr:rXrLr add_real_filerrr'nonexisting_paths r(&test_add_non_existing_real_file_raisesz?RealFileSystemAccessTest.test_add_non_existing_real_file_raisess7<< zBB   w ' ' < < O ) )*: ; ; ; < < < < < < < < < < < < < < < //0@AABBBBBsA""A&)A&cd}|tj5|j|dddn #1swxYwY||j|dS)Nz /nonexisting)r^r_r'rr2rrrTs r(+test_add_non_existing_real_directory_raiseszDRealFileSystemAccessTest.test_add_non_existing_real_directory_raisess)  ! !%, / / A A O . ./? @ @ @ A A A A A A A A A A A A A A A //0@AABBBBBsA  A A ct}|j||tj5|j|ddddS#1swxYwYdSr,)r1rrr^r_rXrSr'real_file_paths r(test_existing_fake_file_raisesz7RealFileSystemAccessTest.test_existing_fake_file_raisess! ##N333  ! !%, / / : : O ) ). 9 9 9 : : : : : : : : : : : : : : : : : :rc|j|j|tj5|j|jddddS#1swxYwYdSr,)rrIrPr^r_rXr2r&s r(#test_existing_fake_directory_raisesz222  ! !%, / / ? ? O . .t~ > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?s A,,A03A0Nc|||kr.||j|nZ||j|||j|t j|}||j||j |j | |j |j d| |j |j d| |j |j d||j|j||j|jdS)Nr)places)r0rrrrr1r<_byte_contentsr5rassertAlmostEqualst_ctimest_atimerrxry)r'r#r[rB real_stats r(check_fake_file_statz-RealFileSystemAccessTest.check_fake_file_stats`  +"?"? OODO22>BB C C C C   T_33NCC D D D OODO22;?? @ @ @GN++  )2333 *I,=>>> y193EaPPP y193EaPPP y193EaPPP )9+;<<< )9+;<<<<RealFileSystemAccessTest.test_add_existing_real_file_read_only&sz22O11.AA  !!)^<<< *U2A666 !!)^<<<<>> ..t/ABBCCC  O " " T/1EFF      O " "27<<0BDU#V#V W W   GLL!35PQQ O++I66  !!)Y777 !!)Y77777r*c ,|j|j||jt j|jddd||jt j|jdd||jt j|jdddS)Npyfakefstestsfake_filesystem_test.pyrr0)rr2rPr0rrrBr:r&s r(%test_add_existing_real_directory_treez>RealFileSystemAccessTest.test_add_existing_real_directory_tree]s **4>:::  O " " N-      O " " T^Z9MNN      O " " T^ZGG       r*c#K|D]#}tj|d|d$dV|D]}tj|ddS)Nrr)rrr)r'symlinksrs r(create_symlinksz(RealFileSystemAccessTest.create_symlinkstsk ) )D JtAwQ ( ( ( (   D Id1g      r*c @ tj|j}tj|jdd}dtj|ddfdtj|ddf|tj|ddftj|d tj|dd fd tj|dd fg}|jd |d d 5}|ddddn #1swxYwY | |5|j |ddddn #1swxYwYn*#t$r|j rtjdwxYw|D]5}||j|d6||jtj|jddd||jtj|jddd||jtj|jddd||jtj|jddd||jtj|jddd||jtj|jddd||jtj|jddd||tj|jdddddS)Nrrr6fixturessymlink_dir_relative../all_tests.pysymlink_file_relativesymlink_dir_absolutez all_tests.pysymlink_file_absolutez/etc/somethingsymlink_file_absolute_outsiderz good morningF lazy_readz,Symlinks under Windows need admin privilegesrzfixtures/symlink_dir_relativez*fixtures/symlink_dir_relative/all_tests.pyzfixtures/symlink_file_relativezfixtures/symlink_dir_absolutez*fixtures/symlink_dir_absolute/all_tests.pyzfixtures/symlink_file_absolutez&fixtures/symlink_file_absolute_outside)rrrrrBr:rPrrrr2rLr rSkipTestr0rrr5r)r'rreal_directoryrrrs r((test_add_existing_real_directory_symlinkzARealFileSystemAccessTest.test_add_existing_real_directory_symlink~s #0AA dnj'JJ ^Z9OPP  " ^Z9PQQ   ^Z9OPP   ^^<< ^Z9PQQ  ! "J0O # 2 ##$4555 Y' - - $ GGN # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ %%h// T T22>U2SSS T T T T T T T T T T T T T T T    X'(VWWW    = =D OODO2247;; < < < <  O " " N3      O " " N@      O " " N4      O " " N3      O " " N@      O " " N4      O " " N<      I N<   dff  sB0EEEF(3F F(F  F(#F $F(('Gc|dtj|jdd}dtj|ddfdtj|dd fg}||5|j|d d dddn #1swxYwY||j d ||j d||j ddS)NT force_real_fsrrr6rrrr/pathFrBr#/path/fixtures/symlink_dir_relative0/path/fixtures/symlink_dir_relative/all_tests.py$/path/fixtures/symlink_file_relative rDrrBr:rPrrr2r0rr'rrs r(4test_add_existing_real_directory_symlink_target_pathzMRealFileSystemAccessTest.test_add_existing_real_directory_symlink_target_path s ***>>>dnj'JJ ^Z9OPP  " ^Z9PQQ    ! !( + +   O . .Gu /                   ../TUUVVV  O " "#U V V    ../UVVWWWWWsCC Cc|dtj|jdd}dtj|ddfdtj|dd fg}||5|j|d d ||j d ||j d ||j dddddS#1swxYwYdS)NTrrrr6rrrrrrrrrrrs r(2test_add_existing_real_directory_symlink_lazy_readzKRealFileSystemAccessTest.test_add_existing_real_directory_symlink_lazy_read s ***>>>dnj'JJ ^Z9OPP  " ^Z9PQQ    ! !( + +   O . .Gt /    OO&&'LMM    OO&&F    OO&&'MNN                     sB%E  EEc|jd|tj5|j|jdddddS#1swxYwYdSrz)rrIr^r_rXr2rPr&s r(6test_add_existing_real_directory_tree_to_existing_pathzORealFileSystemAccessTest.test_add_existing_real_directory_tree_to_existing_path9 s "":...  ! !%, / / W W O . .t~: . V V V W W W W W W W W W W W W W W W W W Ws"A))A-0A-c |j|jd||jt j|jdd| |jt jddddd||jt j|jdd| |jt jdddd dS) Nrr{rrrrrrr0) rr2rPrrrrBr:rOr0r&s r(3test_add_existing_real_directory_tree_to_other_pathzLRealFileSystemAccessTest.test_add_existing_real_directory_tree_to_other_path> sI **4>z*RRR  O " " T/:STT      O " " -      O " " T^Z9MNN      O " " UE:}EE       r*c d|j_|j|j||jt j|jdd||jt j|jdddS)NTrrr0) rrr2rPr0rJrrBr:r&s r(0test_get_object_from_lazily_added_real_directoryzIRealFileSystemAccessTest.test_get_object_from_lazily_added_real_directory[ s,0) **4>:::  O & & T^Z9MNN      O & & T^ZGG       r*c d}tj|jd}|j|||j||||j|j | |j tj|d| ||j|j dS)N@rr) rrBr:rPrrr2r5rrr0rJ assertGreater)r' disk_sizer4s r('test_add_existing_real_directory_lazilyz@RealFileSystemAccessTest.test_add_existing_real_directory_lazilyi s&  T^Z@@  &&y-@@@ **=999 DO$B$B=$Q$Q$VWWW  O & & ],@AA      t55mDDI     r*cd}|j||j|j|jd|||j|jjdS)NrFr)rrrOr2rrr)r'rs r(+test_add_existing_real_directory_not_lazilyzDRealFileSystemAccessTest.test_add_existing_real_directory_not_lazily} s&  &&y$2DEEE **4+=*OOO  t55d6HIIN     r*c|j|jd||j|j||jt j|jd||jt j|jdt j|jd}|j|}| ||| ||dS)NFrvrrzpytest_plugin.py) rr2rOr0rrrBr:rrfrprs r(+test_add_existing_real_directory_read_writezDRealFileSystemAccessTest.test_add_existing_real_directory_read_write s( **4+=*OOO ..t/ABBCCC  O " " T/1EFF      O " "27<<0BDU#V#V W W   GLL!35GHH O++I66  !!)Y777   I66666r*c*tjt}tj|jdd}|j||g|j|}| ||| ||tj|d}|j|}| ||| ||dS)Nrrmodule_with_attributes.py) rrBrPr1r:rOradd_real_pathsrrfrkr'r[ fixture_pathr#s r(&test_add_existing_real_paths_read_onlyz?RealFileSystemAccessTest.test_add_existing_real_paths_read_only s))(33w||D$6LL  && 'EFFFO++N;;  !!)^<<< !!)^<<<l4OPPO++N;;  !!)^<<< !!)^<<<<>>CCC CCC ::: ??? ====    1 1 1===<<<RRR UUU///888"   .A A A FXXX2>WWW    :       (    777" = = = < < < < .__side_effect s+/I (8C8LI 5 5 5r*)r)r'!_FileSideEffectTests__side_effectrs @r( side_effectzFileSideEffectTests.side_effect s6 ', $ M M M M Mr*ctj|_|jd|dS)Nr)r)rrrrrr&s r(r)zFileSideEffectTests.setUp s?)8:: ##OAQAQASAS#TTTTTr*ctj|j}d|_|dd5}|ddddn #1swxYwY||jdSNFrrr)rrrrrr0r'rhandles r(test_side_effect_calledz+FileSideEffectTests.test_side_effect_called s#0AA "' Y , ,  LL                   /00000AAActj|j}d|_|dd5}|ddddn #1swxYwY||jddSr)rrrrrr5rrs r(test_side_effect_file_objectz0FileSideEffectTests.test_side_effect_file_object s#0AA "' Y , ,  LL                   =uEEEEErN)rrrrr)rrrr*r(rr sXUUU 111FFFFFr*r__main__)/rrr_rr1rrrrrrpyfakefs.fake_filesystemrrrr r pyfakefs.helpersr pyfakefs.tests.test_utilsr r rrrrrrrrrrrrrr r"r&r8rHrr+rBrMrrmainrr*r(rsi+* 8888888888$#####IIIIIIIIII]F]F]F]F]FH]F]F]F@=====8===&!L!L!L!L!L!L!L!LHWWWWWHWWW0\H\H\H\H\HX\H\H\H~ N@N@N@N@N@N@N@N@b</</</</</h</</</~+B+B+B+B+BH+B+B+B\g g g g g g g g T MMMMMxMMM .U.U.U.U.U$<.U.U.UbPPPPP,PPPDLLLLL+LLLD77777777*T*T*T*T*T*T*T*TZ"H"H"H"H"H8"H"H"HJnXnXnXnXnXXnXnXnXb`1`1`1`1`1H`1`1`1F ATATATATATXATATATH;;;;;N;;;.V<V<V<V<V<~V<V<V zHMOOOOOr*