+
    Dfj?                    |    R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt R R lt ! R	 R
]4      tR# )z0
Test cases covering L{twisted.python.zippath}.
)annotationsN)Union)_coerceToFilesystemEncoding)
ZipArchiveZipPath)AbstractFilePathTestsc               $    V ^8  d   QhRRRRRR/# )   dirnamezstr | byteszfnamereturnNone )formats   "B/usr/lib/python3/dist-packages/twisted/python/test/test_zippath.py__annotate__r      s!     * *; * * *    c                   \        RV 4      p\        RV4      p\        P                  ! VR4      ;_uu_ 4       p\        P                  ! V4       Fr  w  pppV Fe  p\        P
                  P                  WX4      p	\        P
                  P                  WX4      \        V 4      ^,           R p
VP                  W4       Kg  	  Kt  	  RRR4       R#   + '       g   i     R# ; i)zA
Create a zipfile on zfname, containing the contents of dirname'
 wN)	r   zipfileZipFileoswalkpathjoinlenwrite)r
   r   coercedDirnamecoercedZfnamezfrootignoredfilesfnamefspatharcpaths   &&         r   zipitr'      s     1W=N/F;M		,	,
 WW^$	
d2'',,t3CL14D4FG)  % 
-	,	,	,s   BCC 	c                  l    ] tR t^%t$ RtR]R&   R]R&   R R ltR R ltR	 R
 ltR R lt	R R lt
RtR# )ZipFilePathTestsz_
Test various L{ZipPath} path manipulations as well as reprs for L{ZipPath}
and L{ZipArchive}.
zZipArchive[bytes]r   r!   c                   V ^8  d   QhRR/# r	   r   r   r   )r   s   "r   r   ZipFilePathTests.__annotate__.   s     O Ot Or   c                	   \         P                  ! V 4       \        V P                  V P                  R ,           4       \	        RV P                  4      V n        \        V P                  R ,           4      V n        V P                  V n        V P                   Uu. uF/  qP                  V P                  V P                  R ,           4      NK1  	  upV n	        R# u upi )s   .zipr   N)r   setUpr'   cmnr   	nativecmnr   r   r!   allreplace)selfxs   & r   r.   ZipFilePathTests.setUp.   s    ##D)dhh7*+4RBtxx'12	II	EIXXNXIIdhh7(:;XNNs   5Cc                   V ^8  d   QhRR/# r+   r   )r   s   "r   r   r,   6   s     X Xd Xr   c                    V P                  V P                  P                  R4      P                  R4      V P                  P                  R4      4       R# )z6
L{ZipPath.sibling} returns a path at the same level.
onetwoN)assertEqualr   childsibling)r3   s   &r   test_siblingZipFilePathTests.test_sibling6   s:     	/77>		PU@VWr   c                   V ^8  d   QhRR/# r+   r   )r   s   "r   r   r,   <   s     0 0$ 0r   c                .   V P                   P                  R4      pRP                  \        P                   P	                  V P
                  R,           \        P                  ,           R,           4      4      pV P                  \        V4      V4       V P
                  P                  \        P                  ! 4       \        P                  ,           R^4      R,           p\        V4      pVP                  R4      pV P                  \        V4      V4       R# )zl
Make sure that invoking ZipPath's repr prints the correct class name
and an absolute path to the zip file.
foozZipPath({!r}).zipr   N)r   r;   r   r   abspathr0   sepr:   reprr2   getcwdr   )r3   r;   pathReprrelativeCommonrelpaths   &    r   test_zipPathRepr!ZipFilePathTests.test_zipPathRepr<   s    
 @Dyyu?U"))GGOODNNV3bff<uDE

 	eh/ //		bff0Db!LvU^,e$ 	eh/r   c                   V ^8  d   QhRR/# r+   r   )r   s   "r   r   r,   Q   s     
0 
0$ 
0r   c                .   V P                   P                  R4      P                  R4      P                  R4      pRV P                  R,           \        P                  P                  . RO4      ,           ,          pV P                  \        V4      V4       R# )z
The repr of a ZipPath with C{".."} in the internal part of its path
includes the C{".."} rather than applying the usual parent directory
meaning.
rA   ..barzZipPath(%r)rB   N)r   rA   rN   rO   )r   r;   r0   r   rD   r   r:   rE   )r3   r;   rG   s   &  r    test_zipPathReprParentDirSegment1ZipFilePathTests.test_zipPathReprParentDirSegmentQ   sk     		&,,T288? NNV#bffkk2J&KK
 	eh/r   c                   V ^8  d   QhRR/# r+   r   )r   s   "r   r   r,   ]   s     2 2T 2r   c                   \        V P                  R,           4      pRP                  \        P                  P                  V P                  R,           4      4      pV P                  \        V4      V4       V P                  P                  \        P                  ! 4       \        P                  ,           R^4      R,           p\        V4      pV P                  \        V4      V4       R# )zo
Make sure that invoking ZipArchive's repr prints the correct class
name and an absolute path to the zip file.
rB   zZipArchive({!r})r   N)r   r0   r   r   r   rC   r:   rE   r2   rF   rD   )r3   r   rG   rH   rI   s   &    r   test_zipArchiveRepr$ZipFilePathTests.test_zipArchiveRepr]   s    
 $..612%,,RWW__T^^f=T-UV 	dX. //		bff0Db!LvU^, 	g1r   )r1   r0   r   r!   N)__name__
__module____qualname____firstlineno____doc____annotations__r.   r=   rJ   rP   rT   __static_attributes__r   r   r   r)   r)   %   s5    
 
OX0*
02 2r   r)   )rZ   
__future__r   r   r   typingr   twisted.python.filepathr   twisted.python.zippathr   r   twisted.test.test_pathsr   r'   r)   r   r   r   <module>rb      s5    # 	   ? 6 9*&H2, H2r   