{"DdZddlZddlZddlZddlZddlZddlZddlZddlm Z ddlm Z ddl m Z ddl mZmZmZmZddlmZmZddlmZdd lmZmZdd lmZmZmZmZdd lm Z m!Z!ej"d kZ#Gd dej$e Z%Gdde%Z&Gdde&Z'ej(e# dGdde%Z)Gdde)Z*Gdde%Z+Gdde+Z,Gdde%Z-Gdde-Z.Gd d!e%Z/Gd"d#e/Z0Gd$d%e%Z1Gd&d'e1Z2Gd(d)e%Z3Gd*d+e3Z4Gd,d-e%Z5Gd.d/e5Z6Gd0d1ej$Z7Gd2d3ej$Z8Gd4d5ej$Z9Gd6d7e9Z:Gd8d9e9Z;Gd:d;e9Z<Gd<d=ej$Z=Gd>d?ej$Z>e?d@krej@dABdSdS)Cz Unittests for fake_pathlib. As most of fake_pathlib is a wrapper around fake_filesystem methods, the tests are there mostly to ensure basic functionality. Note that many of the tests are directly taken from examples in the python docs. N) namedtuple)mock)patch) fake_pathlibfake_filesystemfake_filesystem_unittestfake_os)OSTypeFakeFilesystem)FakePathlibModule)IS_PYPYis_root)check_exists_pathlibread_bytes_pathlib read_pathlibread_text_pathlib)RealFsTestMixinskip_if_symlink_not_supportedwin32cDeZdZejdkZd dZdZdZdZ dZ dS) RealPathlibTestCaserrunTestcntj||tj|dSN)rTestCase__init__r)self methodNames r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/tests/fake_pathlib_test.pyrzRealPathlibTestCase.__init__3s2 )224DDD &&&&&ctSr)pathlibrs r used_pathlibz RealPathlibTestCase.used_pathlib7sr chtj|d|_t|_|s4||j|_|| |_ |j j |_ t|_t|_ dSr)rsetUp filesystemosreal_os use_real_fs setUpPyfakefsfscreate_basepathr$r"Pathpathopenr#s rr&zRealPathlibTestCase.setUp:sd### !! #    "gDO  " " "((** L%  r cdS)NFr#s rr*zRealPathlibTestCase.use_real_fsGsur c|tjdkrtjn|t S)N )sys version_info contextlib nullcontext assertWarnsDeprecationWarningr#s rdeprecation_warning_since_313z1RealPathlibTestCase.deprecation_warning_since_313Js:'))  " $ $ $!!"455 r N)r) __name__ __module__ __qualname__r7platform is_windowsrr$r&r*r=r2r rrr0sp(J''''        r rceZdZdZdZdZdZeje ddZ eje ddZ d S) FakePathlibInitializationTestc|d}tr|t||jj|t||jj||j|rN| t5|j ddddS#1swxYwYdS||j dS|t||jj |t||jj||j|rN| t5|jddddS#1swxYwYdS||jdS)z(Make sure tests for class type will workz/testN) r/rB assertTrue isinstancer" WindowsPathPureWindowsPath PurePosixPathr* assertRaisesNotImplementedError PosixPathrr/s rtest_initialization_typez6FakePathlibInitializationTest.test_initialization_typeSsqyy!!  < OOJtT\-EFF G G G OOJtT\-IJJ K K K OODL6688 9 9 9!! :&&':;;--L**,,,------------------ 6 6 8 899999 OOJtT\-CDD E E E OOJtT\-GHH I I I OODL88:: ; ; ;!! <&&':;;//L,,...////////////////// 8 8 : :;;;;;s$C99C=C=(HHHcD||dddd|d|||d|||d|d|d||dd z d z |d d S) zTBasic initialization tests - taken from pathlib.Path documentation. /foobarbaz /foo/bar/baz.foo/bar/etczinit.drebootz/etc/init.d/rebootN assertEqualr/r#s rtest_init_with_segmentsz5FakePathlibInitializationTest.test_init_with_segmentsjs 3ue<W>WXXX diinn555  IIdii&& %(8(8 9 9499Y;O;O     IIf   (8 3 II* + +     r c||d|d||d|d||d|d||ddd|dd S) lTests for collapsing path during initialization. Taken from pathlib.PurePath documentation. zfoo//barrWz foo/./barz foo/../barrX/usrlib64z /usr/lib64N)r[r/assertNotEqualr#s rtest_init_collapsez0FakePathlibInitializationTest.test_init_collapsexs :.. )0D0DEEE ;//91E1EFFF DIIl33TYYy5I5IJJJ 667;;TYY|=T=TUUUUUr c 6|jjj}|||jjdddz}||j|dddf||jd||j|||j|||j d||j d||j d||j |||jjddz||j d|||jjddz||j d||dz||j d ||dS) NrRrSsetup.pysetup.pyr)r(r/sepjoinr[partsdriverootanchornamestemsuffixparentparents)rrjr/s rtest_path_partsz-FakePathlibInitializationTest.test_path_partssglyytw|00zJJJKK c5%%DEEE R((( C((( c*** J/// G,,, e,,, diidgl6G6Gu6U6U0U&V&VWWW  LOTYYsTW\->->ue-L-L'LMM    a$))C%K*@*@AAA a$))C..99999r POSIX specific behaviorcb||d||d||ddSN/a/bza/bzd:/brFr/ is_absolute assertFalser#s rtest_is_absolute_posixz4FakePathlibInitializationTest.test_is_absolute_posixs  &))5577888 5))5577888 6**668899999r Windows specific behaviorcb||d||d||ddSrx)r|r/r{rFr#s rtest_is_absolute_windowsz6FakePathlibInitializationTest.test_is_absolute_windowss 6**6688999 5))5577888  &))557788888r N) r>r?r@rOr\rbruunittestskipIfrBr}rr2r rrDrDRs<<<.    VVV:::"X_Z!:;;::<;: X_^%@AA99BA999r rDceZdZdZdS)RealPathlibInitializationTestcdSNTr2r#s rr*z)RealPathlibInitializationTest.use_real_fstr Nr>r?r@r*r2r rrr#r rr~cVeZdZdZdZdZeje ddZ dS)&FakePathlibInitializationWithDriveTestcD||dddd|d|||d|||d|d|d||dd z d z |d d S) zJBasic initialization tests - taken from pathlib.Path documentationc:/rRrSrTzc:/foo/bar/bazrVrWzc:/Usersjohndatazc:/Users/john/dataNrZr#s rr\z>FakePathlibInitializationWithDriveTest.test_init_with_segmentss  IIeUE5 1 1499=M3N3N    diinn555  IIdii&& %(8(8 9 9499Y;O;O     IIj ! !F *V 3 II* + +     r c||dd|d||dd|ddS)r^z c:/Windowszd:bar/Program Filesc:/Program FilesNrZr#s rrbz9FakePathlibInitializationWithDriveTest.test_init_collapsesx <99499W;M;MNNN  IIl$4 5 5 II( ) )     r c ||jjddd}||jd||jd||jd||jd||jd||j d||j d||j ||jjdd||j d||jjdd||j d |ddS) Nd:python scriptsrd)rrrdrerfrgrrh) r/r(rkr[rlrmrnrorprqrrrsrtrNs rruz6FakePathlibInitializationWithDriveTest.test_path_partssyy**41A:NNOO %IJJJ T*** B''' d+++ J/// G,,, e,,,  K47<#4#4T;K#L#LMM     LO IIdgl''.>?? @ @    a$))D//:::::r zWindows-specific behaviorc||d||d||d||ddS)Nzc:/a/bryc:z //some/sharerzr#s rtest_is_absolutez7FakePathlibInitializationWithDriveTest.test_is_absolutes  (++7799::: 6**6688999 44466777  .11==??@@@@@r N) r>r?r@r\rbrurrrBrr2r rrrst       ;;;$X_^%@AAAABAAAAr rceZdZdZdS)&RealPathlibInitializationWithDriveTestcdSrr2r#s rr*z2RealPathlibInitializationWithDriveTest.use_real_fsrr Nrr2r rrrrr rceZdZdZdZeje ddZdZ dZ dZ dZ eje jd kd d Zd Zd ZdS)FakePathlibPurePathTestz.Tests functionality present in PurePath class.cX||5||d||d||d||dddddS#1swxYwYdSNz/devrQCOM1znul.txt)check_posix_onlyr=r|r/ is_reservedr#s rtest_is_reserved_posixz.FakePathlibPurePathTest.test_is_reserved_posixsL   / / 1 1 A A   TYYv..::<< = = =   TYYs^^7799 : : :   TYYv..::<< = = =   TYYy11==?? @ @ @  A A A A A A A A A A A A A A A A A AC)DD#&D#r~cX||5||d||d||d||dddddS#1swxYwYdSr)check_windows_onlyr=r|r/rrFr#s rtest_is_reserved_windowsz0FakePathlibPurePathTest.test_is_reserved_windowssH !!!  / / 1 1 @ @   TYYv..::<< = = =   TYYs^^7799 : : : OODIIf--99;; < < < OODIIi00<<>> ? ? ?  @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @rc||dd|d||d|d|d||ddd|ddS)NrXpasswd /etc/passwd/foorSrTrUr[r/joinpathr#s r test_joinpathz%FakePathlibPurePathTest.test_joinpaths 6**33H==tyy?W?WXXX  IIf   & &tyy':': ; ; IIm $ $     IIf   & &ue 4 4dii6O6O     r c|||dd|ddS)Nrrr)rr[r/rr#s rtest_joinpath_drivez+FakePathlibPurePathTest.test_joinpath_drivesb !!!  IIdOO $ $%5 6 6 II( ) )     r cT||dd||dd||dd||dd||dddSNza/b.py*.pyz /a/b/c.pyzb/*.pyza/*.pyz/a.pyz/*.pyrFr/matchr|r#s r test_matchz"FakePathlibPurePathTest.test_match  (++11&99:::  +..44X>>??? ;//55h??@@@  '**0099::: 8,,227;;<<<< >z J J II- . .     z * * 3 3 IIe   & &z 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s>)B44B8;B8cB||dd|d||dd|ddSNrz.bz2zc:/Downloads/pathlib.tar.bz2READMEz.txtz README.txtr[r/ with_suffixr#s rtest_with_suffixz(FakePathlibPurePathTest.test_with_suffix#  II3 4 4 @ @ H H II4 5 5     IIh   + +F 3 3TYY|5L5L     r N)r>r?r@__doc__rrrrBrrrrrr7r8rrrr2r rrrs88AAAX_^%@AA@@BA@      ===444X_S%.0RSS66TS6 333     r rceZdZdZdS)RealPathlibPurePathTestcdSrr2r#s rr*z#RealPathlibPurePathTest.use_real_fs.rr Nrr2r rrr-rr rceZdZfdZdZdZdZdZej e j dkddZ d Z d Zd ZxZS) FakePathlibPurePosixPathTestcjt|jj|_dSr)superr&r"rJr/r __class__s rr&z"FakePathlibPurePosixPathTest.setUp3s$  L. r c0|5||d||d||d||dddddS#1swxYwYdSr)r=r|r/rr#s rtest_is_reservedz-FakePathlibPurePosixPathTest.test_is_reserved7s:  / / 1 1 A A   TYYv..::<< = = =   TYYs^^7799 : : :   TYYv..::<< = = =   TYYy11==?? @ @ @  A A A A A A A A A A A A A A A A A AC)D  DDc||dd|d||d|d|d||ddd|d||dd |d dS) NrXrrrrSrTrUrrrr#s rrz*FakePathlibPurePosixPathTest.test_joinpath>s% 6**33H==tyy?W?WXXX  IIf   & &tyy':': ; ; IIm $ $     IIf   & &ue 4 4dii6O6O     IIdOO $ $%5 6 6 II& ' '     r cT||dd||dd||dd||dd||dddSrrr#s rrz'FakePathlibPurePosixPathTest.test_matchLrr c||dd|d||dd|d|t5|ddddddS#1swxYwYdSrrr#s rrz-FakePathlibPurePosixPathTest.test_relative_toSrrrrc|d}||d||ddSrrrNs rrz0FakePathlibPurePosixPathTest.test_is_relative_to]rr cB||dd|d||dd|ddSr)r[r/rr#s rrz+FakePathlibPurePosixPathTest.test_with_namecs  II3 4 4 > >z J J II- . .    5))33J??:AVAVWWWWWr cB||dd|d||dd|ddSrrr#s rrz-FakePathlibPurePosixPathTest.test_with_suffixjrr c|t|dd|t|ddz dz ddS)N /usr/bin/lsusrbinlsz usr/bin/lsr[strr/r#s rtest_to_stringz+FakePathlibPurePosixPathTest.test_to_stringssf TYY}5566 FFF TYYu--5<==|LLLLLr r>r?r@r&rrrrrrr7r8rrrr __classcell__rs@rrr2s/////AAA    ===444X_S%.0RSS66TS6 XXX   MMMMMMMr rceZdZdZdS)RealPathlibPurePosixPathTestcdSrr2r#s rr*z(RealPathlibPurePosixPathTest.use_real_fsyrr Nrr2r rrrxrr rceZdZfdZdZdZdZdZej e j dkddZ d Z d Zd ZxZS) FakePathlibPureWindowsPathTestcjt|jj|_dSr)rr&r"rIr/rs rr&z$FakePathlibPureWindowsPathTest.setUp~s$  L0 r c0|5||d||d||d||dddddS#1swxYwYdSr)r=r|r/rrFr#s rrz/FakePathlibPureWindowsPathTest.test_is_reserveds6  / / 1 1 @ @   TYYv..::<< = = =   TYYs^^7799 : : : OODIIf--99;; < < < OODIIi00<<>> ? ? ?  @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @rc||dd|d||d|d|d||ddd|d||dd |d dS) NrXrrrrSrTrUrrrrr#s rrz,FakePathlibPureWindowsPathTest.test_joinpaths% 6**33H==tyy?W?WXXX  IIf   & &tyy':': ; ; IIm $ $     IIf   & &ue 4 4dii6O6O     IIdOO $ $%5 6 6 II( ) )     r cT||dd||dd||dd||dd||dddSrrr#s rrz)FakePathlibPureWindowsPathTest.test_matchrr c||dd|d||dd|d|t5|ddddddS#1swxYwYdSrrr#s rrz/FakePathlibPureWindowsPathTest.test_relative_torrrrc|d}||d||ddSrrrNs rrz2FakePathlibPureWindowsPathTest.test_is_relative_torr cZ||dd|d|t5|ddddddS#1swxYwYdSr)r[r/rrKrr#s rrz-FakePathlibPureWindowsPathTest.test_with_names  II3 4 4 > >z J J II- . .     z * * 3 3 IIe   & &z 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s*)B  B$'B$cB||dd|d||dd|ddSrrr#s rrz/FakePathlibPureWindowsPathTest.test_with_suffixrr c|t|dd|t|dd|t|ddz dz d|t|d d z d z d z d dS)Nrz \usr\bin\lsz c:/Windows/System32/ntoskrnl.exez c:\Windows\System32\ntoskrnl.exerrrz usr\bin\lszC:/WindowsSystem32z ntoskrnl.exez C:\Windows\System32\ntoskrnl.exerr#s rrz-FakePathlibPureWindowsPathTest.test_to_strings TYY}55668HIII   <== > > 1    TYYu--5<==~NNN   %  9,z9NJ K K 1     r rrs@rrr}s11111@@@    ===444X_S%.0RSS66TS6 333           r rceZdZdZdS)RealPathlibPureWindowsPathTestcdSrr2r#s rr*z*RealPathlibPureWindowsPathTest.use_real_fsrr Nrr2r rrrrr rceZdZfdZdZdZdZdZdZdZ dZ e j e d d Ze j e d d Ze j e d d ZdZe j ejdkddZdZdZdZdZdZdZdZe j ejdkp ejdkdejej ddidZ!e j ejdkdejej d d!id"Z"e j ejdkp ejdkdejej ddid#Z#e j ejdkdejej d d!id$Z$xZ%S)%!FakePathlibFileObjectPropertyTestcxt|jd|_|ddd|_||jd||dd tn#tj $rYdSwxYw| |d|dd|d|_ | |j |j| |d|dd | |d |dd ddS) Nhomejanetest.pysdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacontentsrbroken_dir_linknonebroken_file_link) rr&r(umask make_path file_path create_file create_dirrrSkipTestcreate_symlinkfile_link_pathrs rr&z'FakePathlibFileObjectPropertyTest.setUps  W]]5))  BB *=== vv66777  ) + + + +     FF  DNN622DNN664R4RSSS"nnY77 D/@@@  NN, - -t~~ff/M/M     NN- . . NN669 5 5     s#B22CCcD|j|jdSr)r(rr#s rtearDownz*FakePathlibFileObjectPropertyTest.tearDowns  dj!!!!!r c &t|||j|||dd|||ddd|||d|||j|||d|||ddS)Nr r testrrr)rrFr/rexistsrr|rr#s r test_existsz-FakePathlibFileObjectPropertyTest.test_existss%'''  $.1188::;;;  $.."@"@AAHHJJKKK 4>>&&&#I#IJJQQSSTTT  $.."8"899@@BBCCC  $"566==??@@@ 4>>2C#D#DEELLNNOOO 4>>2D#E#EFFMMOOPPPPPr ct|||j|||d|||d|||j|||d|||ddS)N home/janerrr)rr|r/ris_dirrFrrr#s r test_is_dirz-FakePathlibFileObjectPropertyTest.test_is_dirsO%''' 4>2299;;<<<  $.."="=>>EEGGHHH  $.."8"899@@BBCCC 4#677>>@@AAA 4>>2C#D#DEELLNNOOO 4>>2D#E#EFFMMOOPPPPPr ct|||d|||d|||d|||j|||d|||ddSNzhome/jane/test.pyr!rrr)rrFr/ris_filer|rr#s r test_is_filez.FakePathlibFileObjectPropertyTest.test_is_filesZ%'''  $..1D"E"EFFNNPPQQQ 4>>+#>#>??GGIIJJJ 4>> #9::BBDDEEE  $"566>>@@AAA 4>>2C#D#DEEMMOOPPP 4>>2D#E#EFFNNPPQQQQQr ct|||d|||d|||d|||j|||d|||ddSr%)rr|r/r is_symlinkrFrr#s rtest_is_symlinkz1FakePathlibFileObjectPropertyTest.test_is_symlinksV%''' 4>>2E#F#FGGRRTTUUU 4>>+#>#>??JJLLMMM  $.."8"899DDFFGGG  $"566AACCDDD  $..1B"C"CDDOOQQRRR  $..1C"D"DEEPPRRSSSSSr czt|j|j}||j}||jtjz| |jtj z| |j |j | |j d| |j|j| |tjt!|jdS)Nd)rr(statrr/rr|st_modeS_IFDIRrFS_IFREGr[st_inost_sizest_mtimeST_MTIMEint)r file_stat stat_results r test_statz+FakePathlibFileObjectPropertyTest.test_stats%'''GLL00 ii 34499;;  ,t|;<<<  +dl:;;; +Y-=>>> ,c222 -y/ABBB T]3S9K5L5LMMMMMr c t|j|j}||j}||jtjz||jtj z| |j |j | |j || |j |j dSr)rr(lstatrr/rFr.r-r0S_IFLNKr[r1r2r3)r expected_size link_statr7s r check_lstatz-FakePathlibFileObjectPropertyTest.check_lstats%'''GMM$"566 ii 344::<<   +dl:;;;  +dl:;;; +Y-=>>> ,m<<< -y/ABBBBBr rvcT|t|jdSr)r>lenrr#s rtest_lstat_posixz2FakePathlibFileObjectPropertyTest.test_lstat_posix&s& T^,,-----r r~cLt|ddS)Nr)rr>r#s rtest_lstat_windowsz4FakePathlibFileObjectPropertyTest.test_lstat_windows*s(%''' r c`||j|j}||jtjdz|j|j}|j rdnd}||jtj |zdS)N) rr(r-rr[r.r0r:ris_macosr;)rr6r=modes r test_chmodz,FakePathlibFileObjectPropertyTest.test_chmod/s GLL00  *DL5,@AAAGMM$"566  0uu5 *DL4,?@@@@@r ct|j|j}|j|j}t |jdsb|t5| |j dddddS#1swxYwYdS| |j dtrdnd}| |jtj|z|jrdnd}| |jdztj|zdS)Nlchmod$rE)rr(r-rr:rhasattrr)rKrLr/rLrBr[r.r0 is_windows_fsr;rr6r=rI mode_masks r test_lchmodz-FakePathlibFileObjectPropertyTest.test_lchmod9sy%'''GLL00 GMM$"566 t|X.. U""#677 = = $-..55e<<< = = = = = = = = = = = = = = = = = = IId) * * 1 1% 8 8 8&155ED   Y. t0C D D D!%!3>I   Y.94<);S T T T T Ts<.B77B;>B;r5 z+follow_symlinks argument new in Python 3.10ct|j|j}|j|j}|jj|jjvstrd| t5| |jddddddS#1swxYwYdS| |jddtrdnd}| |jtj|z|jrdnd}| |jdztj|zdS) NrMFfollow_symlinksrNrErOrPrQ)rr(r-rr:rchmodsupports_follow_symlinksr rKrLr/rBr[r.r0rSr;rTs rtest_chmod_no_followsymlinksz>FakePathlibFileObjectPropertyTest.test_chmod_no_followsymlinksHs &'''GLL00 GMM$"566 7= @ @ @G @""#677 S S $-..44UE4RRR S S S S S S S S S S S S S S S S S S IId) * * 0 0 0 N N N&155ED   Y. t0C D D D!%!3>I   Y.94<);S T T T T Ts0CC Cc :||dd||dd|j|d||||jj|d|||jj ddd||jj|dddS)Nantoinedocsrd..) rrrr(chdirassert_equal_pathsr/resolverealpathrkr#s r test_resolvez.FakePathlibFileObjectPropertyTest.test_resolve[sD y&99:::  :>>???  dnnY//000  IIKK   ! ! IIdgl++DNN9,E,EFF G G     IIdgl''jAA B B J J L L IIdgl++DNN9j,Q,QRR S S     r c||d}|jj|d}|||j|dts:|tj ||j dS| d|| j dS)Nsome_dir some_filer)rrr(r/rkrr\rassert_raises_os_errorerrnoEACCESr-r[r2)rdir_pathrs r test_stat_file_in_unreadable_dirzBFakePathlibFileObjectPropertyTest.test_stat_file_in_unreadable_diris >>*--GL%%h <<  ###  h&&&yy E  ' ' dii 6J6J6O P P P P P   Q ) 4 4 9 9 ; ; C D D D D Dr c(||d}|jj|d}|||j|dtstj dkr:| tj ||j dS|| }| tj t|dS|| }tt|d}||ddS)Nrirjrr4)rrr(r/rkrr\rr7r8rkrlrmiterdirlistrrFendswith)rrnritr/s rtest_iterdir_in_unreadable_dirz@FakePathlibFileObjectPropertyTest.test_iterdir_in_unreadable_dirtsD >>*--GL%%h <<  ###  h&&&yy 87**++EL$))H:M:M:UVVVVVYYx((0022++EL$CCCCC8$$,,..BtBxx{##D OODMM+66 7 7 7 7 7r c||||d}|dz }||dd|d||d}||d|t5|j ||dz dddn #1swxYwYtt| d ksJt| d |ksJtt| d d ksJt| d d |ksJ|t5|dddn #1swxYwY|t5|d ddddS#1swxYwYdS)Ntestdirfile.txtheyrGrpermir zlink.txtrhr*.txtutf8encoding)r skip_rootr/rrr\rKPermissionErrorr(linkr@rrrqglobr- read_text)r directoryr another_files r,test_iterdir_and_glob_without_exe_permissionzNFakePathlibFileObjectPropertyTest.test_iterdir_and_glob_without_exe_permissions  IIdnnY7788  *  U???yy !;!;<<  666    / / ? ? GLLy:'= > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4 ))++,,--2222I%%''((+y88884 w//0011Q6666INN7++,,Q/9<<<<   / /   NN                      / / 1 1     0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1s6DD D 0HHH6II!Ic||||d}|dz }||dd|d|t5t| dddn #1swxYwYtt| ddksJ| j dzd ksJ|d dksJdS) NrwrxryrGrzr|rrFr}r~)rrr/rrr\rKrrrrqr@rr-r.r)rrrs r/test_iterdir_impossible_without_read_permissionzQFakePathlibFileObjectPropertyTest.test_iterdir_impossible_without_read_permissionsw  IIdnnY7788  *  U???   / / & & ""$$ % % % & & & & & & & & & & & & & & &4 w//0011Q6666~~'%/58888""F"33u<<<<<>&)) !!!  h  IMMOOTYYtw|'<'r?r@r&rrr#r'r*r8r>rrrBrArCrJrVr7r8r^rgrorurrrrrArdictr(environrrrrrrs@rrrsw     *"""QQQQQQRRRTTT N N N C C CX_Z!:;;..<;.X_^%@AABAX_Z!:;;AA<;A U U UX_ 7"5 U U  U     E E E888"1116===$///   X_ <3#3f#<>UUZ ],<=>>  ?> X_S\W,.CDDUZ V\233OO43EDOX_ <3#3f#<>UUZ ],<=>>  ?> X_S\W,.CDDUZ V\233DD43EDDDDDDr rceZdZdZdS)!RealPathlibFileObjectPropertyTestcdSrr2r#s rr*z-RealPathlibFileObjectPropertyTest.use_real_fsrr Nrr2r rrrrr rceZdZdZdZdZdZeje j dkddZ dZ d Z d Zeje j d kd d ZdZdZdZdZdZdZdZdZdZeje j dkdeje j dkddZeje j d kddZeje j dkddZd Zd!Zeje d"d#Zeje d"d$Z d%Z!d&Z"d'Z#d(Z$d)Z%d*Z&d+S), FakePathlibPathFileOperationTestz5Tests methods related to file and directory handling.c t||ddd||dd||d|dd||d|dd|||ddd|||dd|||d|||d|||ddddS)Nr r r rrr) rrrrrrFr/rr|r#s rrz,FakePathlibPathFileOperationTest.test_existss%'''  BBCCC vv66777 DNN622DNN664R4RSSS DNN622DNN664R4RSSS  $.."K"KLLSSUUVVV  $.."@"@AAHHJJKKK  $.."8"899@@BBCCC 4>> #9::AACCDDD 4>>&&&#I#IJJQQSSTTTTTr c`||d|t5||ddddddn #1swxYwY||dddd||jj |dddS)NrRbar.txtr}r~w) rrrKOSErrorr/r0closerFr(rr#s r test_openz*FakePathlibPathFileOperationTest.test_opensB u--...   w ' ' N N IIdnnUI66 7 7 < B  BBc||dd||d}||dddS)N text_filerRr r}r~rrr/r[rrrs rtest_read_textz/FakePathlibPathFileOperationTest.test_read_textsq  44uEEEIIdnn[99::  ,,f,==uEEEEEr r5 z%is_junction method new in Python 3.12c||dd||d}||dS)NrrRr )rrr/r| is_junctionrs rtest_is_junctionz1FakePathlibPathFileOperationTest.test_is_junctionsl  44uEEEIIdnn[99::  ..0011111r c||ddd||d}||dddS)Nru ерундаcyrillic)rrr~rrs rtest_read_text_with_encodingz=FakePathlibPathFileOperationTest.test_read_text_with_encodings~  NN; ' '.:    IIdnn[99::  ,,j,AA>RRRRRr c|d}||}|dd||jj|||ddS)NrrRr}r~)rr/ write_textrFr(rcheck_contentsr path_namers rtest_write_textz0FakePathlibPathFileOperationTest.test_write_texts}NN;// IIi(( UV444  ++I66777 Iu-----r c>|d}||}|dd||jj|||dddS)Nruανοησίεςgreekr~)rr/rrFr(rrencoders rtest_write_text_with_encodingz>FakePathlibPathFileOperationTest.test_write_text_with_encodingsNN;// IIi(( /'BBB  ++I66777 I'9'@'@'I'IJJJJJr rWz#newline argument new in Python 3.10c||d}|ddd||d|ddd||d|ddd||d |dd d||d dS) Nrjz1 2 3 4rer})newliners1 2 3 4 z s 1 2 3 4 s1 2 3 4)r/rrrrNs rtest_write_with_newline_argz?????r cl|dd}||d|dd}|||||jj|||ddS)NrRrrr baz.txt)rrr/renamer|r(rr)r file_name new_file_names r test_renamez,FakePathlibPathFileOperationTest.test_rename5sNN5)44  V444ui88  )##M222 ,,Y77888 M622222r c2||ddd||ddd||dd|dd||jj|dd||ddddS)NrRrrr rSzold.txtreplaced)rrr/replacer|r(rrr#s r test_replacez-FakePathlibPathFileOperationTest.test_replace=s y99FKKK y99JOOO $.. 2233;; NN5) , ,    ,,T^^E9-M-MNNOOO DNN5)< >uk22                  yy##^^E;77   w ' ' & & MM* % % % & & & & & & & & & & & & & & &   w ' ' 1 1 MM$))J// 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 z22333 tyy'<'<==>>>  dnnUD%&S&STTUUU  MM$))DNN5$y$Q$QRR S S     s71ACCCEEE%)FF!Fct|dd}|||d}||}||||jj|||dS)NrRr link_to_bar) rrrr/ symlink_torFr(rr)rr link_namer/s rtest_symlink_toz0FakePathlibPathFileOperationTest.test_symlink_toss%'''NN5)44  ###NN=11 yy##  """  ++I66777 ))*****r rzlink_to new in Python 3.8zlink_to removed in Python 3.12ctt|dd}|||d|j|j|d}||}||| |jj || | |d|j|jdSNrRrrhrri) rrrr[r(r-st_nlinkr/link_torFrr|r)rs r test_link_toz-FakePathlibPathFileOperationTest.test_link_to}s &'''NN5)44  ### DGLL33<===NN=11 yy## Y  ++I66777 **+++ DGLL33<=====r zhardlink_to new in Python 3.10c~|dd}|||d|j|j||d}||}||||jj || | |d|j|jdSr) rrr[r(r-rr/ hardlink_torFrr|r))rr link_pathr/s rtest_hardlink_toz1FakePathlibPathFileOperationTest.test_hardlink_tosNN5)44  ### DGLL33<===IIdnn];;<< yy##d###  ++I66777 **+++ DGLL33<=====r rzreadlink new in Python 3.9cFt|ddd}|d}|||||}||||dSNrRrSrTtarJAY)rrrr/rdreadlink)rrtargetr/s r test_readlinkz.FakePathlibPathFileOperationTest.test_readlinks%'''NN5%77 )) Iv...yy##  61B1BCCCCCr c|dd}|tj||j||d||jj||tj ||jdS)NrRrSTrt) rrkrlENOENTr/mkdirrFr(rrrdir_names r test_mkdirz+FakePathlibPathFileOperationTest.test_mkdirs>>%// ##EL$))H2E2E2KLLL (!!$!///  ++H55666 ##EL$))H2E2E2KLLLLLr c|dd}||||d|jj|d}|||tj ||jddS)NrRrSTrrT) rrr/r r(rkrrkrlr)rr rs rtest_mkdir_exist_okz4FakePathlibPathFileOperationTest.test_mkdir_exist_oks>>%// !!! (!!4!000GL%%h66  ### ## L$))I..4t $     r r~c||dd||ddS)Nz\\test\unc\fooTr skip_real_fsr/r rFrr#s r"test_mkdir_with_automount_unc_pathzCFakePathlibPathFileOperationTest.test_mkdir_with_automount_unc_pathsi  #$$**4*888  "344;;==>>>>>r c||dd||ddS)Nz d:\foo\barTrrr#s rtest_mkdir_with_automount_drivez@FakePathlibPathFileOperationTest.test_mkdir_with_automount_drivesg  -  &&t&444  -007799:::::r cL|dd}||||||jj|||jj|d||dd| t5||ddddn #1swxYwY||jj|ddSNrRrSrT) rrr/rmdirr|r(rrFrrKrr s r test_rmdirz+FakePathlibPathFileOperationTest.test_rmdirs>>%// !!! (!!### ,,X66777  ++DNN5,A,ABBCCC u55666   w ' ' 5 5 IIdnnU++ , , 2 2 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5  ++DNN5,A,ABBCCCCCs ;EEEc R||ddd||ddd||ddd||dd}d|D}|dt ||||ddd|dS)NrRrSfile1file2file3cg|]}|Sr2r2.0entrys r zAFakePathlibPathFileOperationTest.test_iterdir..s666eE666r r5)rrr/rqr[r@assertIn)rr/rs r test_iterdirz-FakePathlibPathFileOperationTest.test_iterdirs ug>>??? ug>>??? ug>>???yyu556666t||~~666 CMM*** diiueW E EFFQQQQQr c ||dd||dd||dd||dd||d}|||dd||ddgt |ddS)NrRrdz all_tests.py README.mdz setup.pycr)rrr/r[sortedrrNs r test_globz*FakePathlibPathFileOperationTest.test_globs! z::;;; ~>>??? {;;<<< {;;<<<yy..//  $..??@@ $.. ;;<<  499V$$ % %      r c"||d}||dd}||||dz gt |ddS)NrnrRr)r/rrr[rrr)rroot_dir test_files r test_glob_dirz.FakePathlibPathFileOperationTest.test_glob_dirs99T^^F3344NN8UI>>  ### (U*+T(--2F2F-G-GHHHHHr c "|||dd||dd||dd||dd||d}|||dd||dd||ddgt |ddS)NrRrd all_tests.PYr& example.Pyr)rrrr/r[r'rrNs rtest_glob_case_windowsz7FakePathlibPathFileOperationTest.test_glob_case_windowssP !!! z::;;; ~>>??? {;;<<< |<<===yy..//  $..??@@ $.. ==>> $.. ;;<<  499V$$ % %      r c |tjdkr&tjdkr|d||dd||dd||dd||dd ||d}|t| d ||ddgdS) Nrrz%Ignoring inconsistent path delimiters)reasonrRrdr.r&r/r) rr7rAr8skipTestrrr/r[r'rrNs rtest_glob_case_posixz5FakePathlibPathFileOperationTest.test_glob_case_posixsA  <7 " "s'7''A'A MM!HM I I I z::;;; ~>>??? {;;<<< |<<===yy..//  499V$$ % % YYt~~eZ88 9 9 :     r N)'r>r?r@rrrrrrr7r8rrrrrrrrrrrrrrrrrr rrBrrrr$r(r,r0r4r2r rrrs#?? U U UOOOFFF X_ 7"/22 2 SSS...KKKX_S%/1VWW 3 3XW 3JJJ @@@333JJJ999---///   ,+++X_S%.0KLLX_S%02RSS > >TSML >X_S%/1QRR > >SR >X_S%.0LMMDDNMDMMM   X_^%@AA??BA? X_^%@AA;;BA; D D DRRR    III        r rceZdZdZdS) RealPathlibPathFileOperationTestcdSrr2r#s rr*z,RealPathlibPathFileOperationTest.use_real_fsrr Nrr2r rr6r6rr r6ceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZe j!e"o e#j$dkdd Z%e j!e"o e#j$dkdd!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-e j!e#j$d)kd*d+Z.d,Z/d-Z0e j!e#j1d.kd/d0Z2e j!e#j1d.kd/d1Z3d2Z4e j!e#j$d3kd4d5Z5e j!e#j$d3kd4d6Z6e j!e#j$d3kd4d7Z7e j!e#j$d3kd8d9Z8e j!e#j$d3kd:d;Z9e j!e#j$d3kd:d<Z:e j!e#j$d3kd:d=Z;e j!e#j$d3kd>d?Z)>tyy)O)O     r c|dddd}||jj||jj||dSNrRrSrbrT)rr[r(r/normpathrFs r test_normpathz/FakePathlibUsageInOsFunctionsTest.test_normpathn~~eUD%88  GL ! !$ ' ')>)>tyy)O)O     r c|dddd}||jj||jj||dSrI)rr[r(r/rfrFs r test_realpathz/FakePathlibUsageInOsFunctionsTest.test_realpath%rLr c r|ddd}|ddd}|jj||}|||jj||||||jj||||||jj||||dS)Nr/rrRrS)rr(r/relpathr[)rpath_foopath_barrel_paths r test_relpathz.FakePathlibUsageInOsFunctionsTest.test_relpath+s>>&$66>>&$667<''(;; 47<#7#7 (8K8KX#V#VWWW 47<#7#7$))HBUBU#V#VWWW   GL 8!4!4dii6I6I J J     r c|ddd}||jj||jj||dSrA)rr[r(r/splitrFs r test_splitz,FakePathlibUsageInOsFunctionsTest.test_split6sb~~eUE22 ++D1147<3E3EdiiPToo3V3VWWWWWr c|dddd}||jj||jj||dS)NzC:rBrCrD)rr[r(r/ splitdriverFs rtest_splitdrivez1FakePathlibUsageInOsFunctionsTest.test_splitdrive:so~~dE5%88  GL # #D ) ) GL # #DIIdOO 4 4     r c|dddd}||jj||jj||dSrI)rr[r(r/abspathrFs r test_abspathz.FakePathlibUsageInOsFunctionsTest.test_abspathAn~~eUD%88  GL  & & (<()>tyy)O)O     r cb||dd}|j|}d|_||jj||jj||dS)NrRrf*) rrr'rst_ctimer[r(r/getctimerjs r test_getctimez/FakePathlibUsageInOsFunctionsTest.test_getctimec ~~eZ00?..t44  GL ! !$ ' ')>)>tyy)O)O     r cb||dd}|j|}d|_||jj||jj||dS)NrRrf ) rrr'rst_atimer[r(r/getatimerjs r test_getatimez/FakePathlibUsageInOsFunctionsTest.test_getatimelrrr c(|ddd}||d||jj||jj||dSNrRrSrT1234567r )rrr[r(r/getsizerNs r test_getsizez.FakePathlibUsageInOsFunctionsTest.test_getsizeus~~eUE22  222  GL  & & (<(|dd}||||dz||j||j||dS)NrRrSr)rrrr[r(listdirr/rNs r test_listdirz.FakePathlibUsageInOsFunctionsTest.test_listdirs~~eU++   )*** .. $0P0PQQQQQr c|d}|j||||jj|dS)NrR)rr(r r/rFrrNs rr z,FakePathlibUsageInOsFunctionsTest.test_mkdirs[~~e$$  diioo&&&  ++D1122222r c|dd}|j||||jj|dSr;)rr(makedirsr/rFrrNs r test_makedirsz/FakePathlibUsageInOsFunctionsTest.test_makedirss_~~eU++ 4)))  ++D1122222r rzQos.readlink does not to support path-like objects under Windows before Python 3.8c(t|ddd}|d}|||||j|||dSrrrrrdr(rr/rrrs rrz/FakePathlibUsageInOsFunctionsTest.test_readlinks &'''NN5%77 )) Iv...  0 091E1E F FOOOOOr c(t|ddd}|d}|||||j|||dS)NsfoosbarsbazstarJAYrrs rtest_readlink_bytesz5FakePathlibUsageInOsFunctionsTest.test_readlink_bytess &'''NN666::  ** Iv...  0 091E1E F FOOOOOr c|d}|||j||||jj|dS)Ntest.txt)rrr(remover/r|rrNs r test_removez-FakePathlibUsageInOsFunctionsTest.test_removesq~~j))  tyy''' ,,T2233333r c*|d}|d}|||j|||||jj||j||||||jj|dSNz test1.txtz test2.txt)rrr(rr/rFrrpath1path2s rrz-FakePathlibUsageInOsFunctionsTest.test_renames{++{++  tyy''///  ++E22333 tyy''5)9)9:::  ++E2233333r c*|d}|d}|||j|||||jj||j||||||jj|dSr)rrr(rr/rFrrs rrz.FakePathlibUsageInOsFunctionsTest.test_replaces{++{++   %((%000  ++E22333  %(($))E*:*:;;;  ++E2233333r c|dd}|||j||||jj|dSr;)rrr(rr/r|rrNs rrz,FakePathlibUsageInOsFunctionsTest.test_rmdirsq~~eU++   diioo&&& ,,T2233333r cv|dd}||||jj|dd|j||D}|dt|dS)Nxyzzyplughrcg|]}|Sr2r2rs rr"zBFakePathlibUsageInOsFunctionsTest.test_scandir..sPPPuPPPr rh) rrrr(r/rkscandirr[r@)rr dir_entriess r test_scandirz.FakePathlibUsageInOsFunctionsTest.test_scandir sNN7G44   """ **9jAABBBPP$'//$))I:N:N*O*OPPP  C ,,-----r czt|d}|d}|||j|||||jj||j||j||||||jj|dS)Nrr) rrrr(symlinkr/rFrr)rrrs r test_symlinkz.FakePathlibUsageInOsFunctionsTest.test_symlinks%'''NN<00 NN6**  ###  ),,i888  ++I66777 y!!!  ),,dii .B.BCCC  ++I6677777r c|ddd}||d||j|||dSry)rrr[r(r-r/rNs rr8z+FakePathlibUsageInOsFunctionsTest.test_statsp~~eUE22  222 d++TYYt__-A-A-C-CDDDDDr rWzNew in Python 3.10c||d}d}||jj||}||jj|d}d}|||||||t|| dtj |t|| dtj dS) NrRrSrrr TrZF) rrr/r(rkrrr[r@r-ST_SIZE)rr base_namerrrs rtest_stat_follow_symlinksz;FakePathlibUsageInOsFunctionsTest.test_stat_follow_symlinks!s$ NN5))  IIdgl// 9EEFF IIdgl// 6BBCC  X666 Iy111  MM9>>$>?? M      NNINN5NAA$,O     r c\|d}||d|j||d|j|}|d|j|d|jdS)Nrjrr )rhri)timesrhri) rrr(utimer/r-r[rur3rr/sts r test_utimez,FakePathlibUsageInOsFunctionsTest.test_utime2s~~k** ///  diiooV 444 W\\$   BK((( BK(((((r c&|d}||d|j||d|j|}|d|jdS)Nrj test_testr )length)rrr(truncater/r-r[r2rs r test_truncatez/FakePathlibUsageInOsFunctionsTest.test_truncate:s~~k**  444 4333 W\\$   BJ'''''r rz!no pwd and grp modules in WindowscB|d}||||||||dSNrj)rrrFr/ownergrouprNs rtest_owner_and_group_posixz.fake_getpwuidJs.byy(1BCC &/ #""Nr cN|dkrtdd}d|_|St)Nrzgr_name, gr_gidNewGroup)rgr_namer)r group_structs r fake_getgrgidzUFakePathlibUsageInOsFunctionsTest.test_changed_owner_and_group..fake_getgrgidQs.axx)'3DEE '1 $##Nr rjrnrz pwd.getpwuidz grp.getgrgidrr) rrrr(chownrrr[r/rr)rrrr/s rtest_changed_owner_and_groupz>FakePathlibUsageInOsFunctionsTest.test_changed_owner_and_groupHs       ~~k**   dB""" Z 6 6 F FNM:: F F  DIIdOO,A,A,C,CDDD  TYYt__-B-B-D-DEEE F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F F Fs76D' A7D D'D D'D D''D+.D+c||d}|||t5||dddn #1swxYwY|t5||ddddS#1swxYwYdSr)rrrrKrLr/rrrNs rtest_owner_and_group_windowsz>FakePathlibUsageInOsFunctionsTest.test_owner_and_group_windowsasT !!!~~k**    2 3 3 $ $ IIdOO ! ! # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $   2 3 3 $ $ IIdOO ! ! # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $s$(B  BB2(C''C+.C+)r5zcopy() is new in Python 3.14c||d}|d}||d||}||t ||||d|dSNrjsome_other_filerr  r/rrcopyr[rrFrrr source_path target_pathrs rtest_copy_new_filez4FakePathlibUsageInOsFunctionsTest.test_copy_new_filejsii{ ; ;<< nn%677  v666!!+.. c&kk222  ((( !1!1!3!344444r c8||d}|d}||d||d||}||t ||||||d|dSNrjrrRr rSrrs rtest_copy_to_existing_filezz>FakePathlibUsageInOsFunctionsTest.test_walk..s"??td??????r rirrhN) rr/rrrrr(walkr@rk)rbase_dir base_pathresults r test_walkz+FakePathlibUsageInOsFunctionsTest.test_walks>>%((IIh''   """ W,--- U*W4555??tw||I'>'>?????6{{aayXw :::::ayTW\..x??gYOOOOOOOr N)>r>r?r@rr?rGrKrNrTrWrZr]rrbrdrlrqrwr|rrrrrrrrrJrrr rrrrBr7r8rrrrrrrrr8rrrrArrrrrrrrrrr rr2r rr9r9 sF TTT            XXX                           XXX         XXX       OOO... 9 9 9RRR 333 333 X_0s'&0 * PP  PX_0s'&0 * PP  P444 444444444 ... 8 8 8EEE X_S%/1EFF  GF )))(((X_S\W,.QRR11SR1 X_S\W,.QRRFFSRF0$$$X_S%/1OPP55QP5X_S%/1OPP 4 4QP 4X_S%/1OPP > >QP >X_S%/1TUU 4 4VU 4X_S%/1OPP55QP5X_S%/1OPP 4 4QP 4X_S%/1OPP > >QP >X_S%/1TUU 4 4VU 4 P P P P Pr r9ceZdZdZdS)!RealPathlibUsageInOsFunctionsTestcdSrr2r#s rr*z-RealPathlibUsageInOsFunctionsTest.use_real_fsrr Nrr2r rrrrr rc2eZdZdZdZdZdZdZdZdS) FakeFilesystemPathLikeObjectTestctj|_tj|j|_t j|j|_dSr) rr r'rr r"r FakeOsModuler(r#s rr&z&FakeFilesystemPathLikeObjectTest.setUps>)8::#5doFF &t77r cjd}|j|}|j|||jj||tj |j |j tj zdSN foo/bar/baz) r"r.r'rrFr(r/rr[r-r/r.)rdir_path_stringrns r!test_create_dir_with_pathlib_pathzBFakeFilesystemPathLikeObjectTest.test_create_dir_with_pathlib_paths'<$$_55 ""8,,,  ++O<<===  L$',,77?$,N     r cjd}|j|}|j|||jj||tj |j |j tj zdSr) r"r.r'rrFr(r/rr[r-r0r.)rfile_path_stringrs r"test_create_file_with_pathlib_pathzCFakeFilesystemPathLikeObjectTest.test_create_file_with_pathlib_paths(L%%&677  ##I...  ++,<==>>>  L$',,'788@4<O     r c|jd}d}|j|}|j||||jj||tj |j |j tj zdS)Nrzfoo/link) r"r.r'rrFr(r/rar[r-r;r:r.)rrlink_path_stringrs r%test_create_symlink_with_pathlib_pathzFFakeFilesystemPathLikeObjectTest.test_create_symlink_with_pathlib_pathsL%%m44 %L%%&677  &&y)<<<  ,,-=>>???  L GMM* + + 3dl B     r ctjt}|j|}|j||tj |jj }| |jj || tj|j |jtjzdSr)r(r/r\__file__r"r.r' add_real_filerrjrFrr[r-r0r.)rreal_file_path_stringreal_file_pathfake_filepath_strings r-test_add_existing_real_file_with_pathlib_pathzNFakeFilesystemPathLikeObjectTest.test_add_existing_real_file_with_pathlib_paths " 9 9**+@AA %%n5554<>  **=999199"&$'+NN  ++,?@@AAA  L GLL, - - 5 D     r N) r>r?r@r&r r#r&r-r4r2r rrrsn888                     r rc\eZdZddZejejdkddZdS)FakeFilesystemChmodTestreturnNc.|dSrr+r#s rr&zFakeFilesystemChmodTest.setUps r rrc tj|j_t r|dt jd}|j||j dd| | |j ddd| t5| ddddS#1swxYwYdS)Nz!Test only valid for non-root userz/foo/barrrT)force_unix_mode)r WINDOWSr,r(rr3r"r.rr\rFr&rKrrNs r'test_is_file_for_unreadable_dir_windowsz?FakeFilesystemChmodTest.test_is_file_for_unreadable_dir_windowss ^ 99 ? MM= > > >|J'' D!!!  fe$$$  '''  feT :::    / /   LLNNN                  s!DD D)r7N) r>r?r@r&rrr7rAr=r2r rr6r6s[X_S\W,.EFF  GF   r r6cheZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdS)FakePathlibModulePurePathTestcZd}tj|j}|d||||t j|j||tj|jdS)NC:\Windows\cmd.execmdr"rIrqr[r+rr rr/ pure_results r(test_windows_pure_path_parsing_backslashzFFakePathlibModulePurePathTest.test_windows_pure_path_parsing_backslash0$-d338   ,,,   7GGMMR    g&=d&C&C&HIIIIIr cZd}tj|j}|d||||t j|j||tj|jdS)NC:/Windows/cmd.exerBrCrDs r,test_windows_pure_path_parsing_forward_slashzJFakePathlibModulePurePathTest.test_windows_pure_path_parsing_forward_slash;rGr cZd}tj|j}|d||||t j|j|tj|j|dS)N /bin/bashbash)r"rJrqr[r+rr rDs rtest_posix_pure_path_parsingz:FakePathlibModulePurePathTest.test_posix_pure_path_parsingFs+D116  ---   7EEdKKP    .t449;GGGGGr cd}ttj|}|d||||tt j||ttj||dS)NrA)rr"rIr[r+rr rDs r$test_windows_pure_path_str_backslashzBFakePathlibModulePurePathTest.test_windows_pure_path_str_backslashQs$'1$7788  . <<<   \;KKDQQRR    W4T::;;[IIIIIr c\d}ttj|}|d|ttj|j}|d||||ttj|||ttj|||tj|jdS)NrIrArB) rr"rIr[rJrqr+rr )rr/pure_result_winpure_result_posix_stems r(test_windows_pure_path_str_forward_slashzFFakePathlibModulePurePathTest.test_windows_pure_path_str_forward_slash\s#g5d;;<< .@@@!$W%:4%@%@%E!F!F  6777   S!?!O!OPT!U!UVV    #g.Ed.K.K*L*LMMM /1Ft1L1L1QRRRRRr cd}ttj|}|d||||tt j|||ttj|dS)Nz \bin\bashrr"rJr[r+rr rDs r"test_posix_pure_path_str_backslashz@FakePathlibModulePurePathTest.test_posix_pure_path_str_backslashjs'/5566  {333   \;II$OOPP    c'*?*E*E&F&FGGGGGr cd}ttj|}|d||||tt j|||ttj|dS)NrLrVrDs r&test_posix_pure_path_str_forward_slashzDFakePathlibModulePurePathTest.test_posix_pure_path_str_forward_slashus'/5566  {333   \;II$OOPP    c'*?*E*E&F&FGGGGGr ctj|}||||||t j|||tj|dSr)r"rJr{r[r+rr rr/expected_resultrEs r!check_posix_pure_path_is_absolutez?FakePathlibModulePurePathTest.check_posix_pure_path_is_absolutes+D11==??  +666     * 8 8 > > J J L L    g&;D&A&A&M&M&O&OPPPPPr c4|dddS)NrLTr\r]r#s r2test_posix_pure_path_is_absolute_for_absolute_pathzPFakePathlibModulePurePathTest.test_posix_pure_path_is_absolute_for_absolute_paths! ..{D.QQQQQr c4|dddS)Nzbin/bashFr_r`r#s r/test_posix_pure_path_is_absolute_for_local_pathzMFakePathlibModulePurePathTest.test_posix_pure_path_is_absolute_for_local_paths! ..z5.QQQQQr c4|dddS)Nz ../bin/bashFr_r`r#s r2test_posix_pure_path_is_absolute_for_relative_pathzPFakePathlibModulePurePathTest.test_posix_pure_path_is_absolute_for_relative_paths! ..}e.TTTTTr ctj|}||||||t j|||tj|dSr)r"rIr{r[r+rr r[s r#check_windows_pure_path_is_absolutezAFakePathlibModulePurePathTest.check_windows_pure_path_is_absolutes-d33??AA  +666     * : :4 @ @ L L N N    g&=d&C&C&O&O&Q&QRRRRRr c2|dddS)NrITrgr#s r4test_windows_pure_path_is_absolute_for_absolute_pathzRFakePathlibModulePurePathTest.test_windows_pure_path_is_absolute_for_absolute_paths 001EtLLLLLr c4|dddS)Nz ./cmd.exeFr_rir#s r1test_windows_pure_path_is_absolute_for_local_pathzOFakePathlibModulePurePathTest.test_windows_pure_path_is_absolute_for_local_paths! 00e0TTTTTr c4|dddS)Nz ../cmd.exeFr_rir#s r4test_windows_pure_path_is_absolute_for_relative_pathzRFakePathlibModulePurePathTest.test_windows_pure_path_is_absolute_for_relative_paths! 00u0UUUUUr N)r>r?r@rFrJrNrPrTrWrYr]rarcrergrjrlrnr2r rr?r?/s$ J J J J J J H H H J J J S S S H H H H H H Q Q QRRRRRRUUU S S SMMMUUUVVVVVr r?ceZdZfdZxZS)$FakePathlibModulePurePathTestWindowsc ftjdi|tj|j_dSNr2)rr+r r<r,r(rkwargsrs rr+z2FakePathlibModulePurePathTestWindows.setUpPyfakefss/'''''^ r r>r?r@r+rrs@rrprps8$$$$$$$$$r rpceZdZfdZxZS)"FakePathlibModulePurePathTestMacosc ftjdi|tj|j_dSrr)rr+r MACOSr,r(rss rr+z0FakePathlibModulePurePathTestMacos.setUpPyfakefs/'''''\ r rurs@rrwrw8"""""""""r rwceZdZfdZxZS)"FakePathlibModulePurePathTestLinuxc ftjdi|tj|j_dSrr)rr+r LINUXr,r(rss rr+z0FakePathlibModulePurePathTestLinux.setUpPyfakefsrzr rurs@rr}r}r{r r}cpeZdZdZdZdZdZeje o e j dkddZ dS) SkipPathlibTestc4|dgdS)Nskipped_pathlib)additional_skip_namesr9r#s rr&zSkipPathlibTest.setUps# 2C1DEEEEEr cttd}||ddSNskipped_pathlib.pyz## Licensed under the Apache License)rrF startswithrrs rtest_open_in_skipped_modulez+SkipPathlibTest.test_open_in_skipped_modules7 455 ++,QRRSSSSSr cttd}||ddSr)rrFrrs r test_read_text_in_skipped_modulez0SkipPathlibTest.test_read_text_in_skipped_modules7$%9:: ++,QRRSSSSSr cttd}||ddS)Nrs## Licensed under the Apache License)rrFrrs r!test_read_bytes_in_skipped_modulez1SkipPathlibTest.test_read_bytes_in_skipped_modules7%&:;; ++,RSSTTTTTr rz"Ignoring error in outdated versioncH|tdSr)rFrr#s rrzSkipPathlibTest.test_existss# ,../////r N) r>r?r@r&rrrrrr r7r8rr2r rrrsFFFTTT TTT UUU X_-C$v-/S00000r rceZdZdZdS)InstantiatedPathlibTestct}t|}t|d}|dt |dS)NrQr)r r rrr.rqr[r@)rfake_fsfake_pathlib_moduletop_level_dirss rtest_instantiated_pathlibz1InstantiatedPathlibTest.test_instantiated_pathlibsg ""/88166s;;CCEEFF C//00000r N)r>r?r@rr2r rrrs#11111r r__main__ri) verbosity)Arr9rlr(r"r-r7r collectionsrr unittest.mockrpyfakefsrrrr pyfakefs.fake_filesystemr r pyfakefs.fake_pathlibr pyfakefs.helpersr rpyfakefs.tests.skipped_pathlibrrrrpyfakefs.tests.test_utilsrrrArBrrrDrrrrrrrrrrrrrr6r9rrr6r?rprwr}rrr>mainr2r rrsX  """"""UUUUUUUUUUUU;;;;;;;;333333-------- UTTTTTTT \W $      2;_   DJ9J9J9J9J9$7J9J9J9Z$A Z!<==1A1A1A1A1A-@1A1A>=1Ah-S L L L L L 1L L L ^5 CMCMCMCMCM#6CMCMCML#? L L L L L %8L L L ^%C IDIDIDIDID(;IDIDIDX(I ` ` ` ` ` ':` ` ` F 'G OPOPOPOPOP(;OPOPOPd(I 7 7 7 7 7 x'87 7 7 t6?(wVwVwVwVwV$<$EwVwVwVt$$$$$+H$$$ """"")F""" """"")F""" 00000.7000411111h/111 zHMAr