
    2i                         S SK r S SKrS SKrS SKJrJr  SSKJr   " S S\R                  5      r
 " S S\R                  5      rg)	    N)CompatibilityFiles	wrap_spec   )utilc                       \ rS rSr\S 5       r\S 5       rS rS rS r	S r
S rS	 rS
 rS rS rS rS rS rS rS rS rSrg)CompatibilityFilesTests   c                 Z    [         R                  " S5      n[        R                  " USSS9$ )N   Hello, world!	some_pathabc)filepathcontents)ioBytesIOr   create_package)self
bytes_datas     k/home/james-whalen/.local/lib/python3.13/site-packages/importlib_resources/tests/test_compatibilty_files.pypackageCompatibilityFilesTests.package   s-    ZZ 01
""$
 	
    c                 B    [         R                  " U R                  5      $ N	resourcesfilesr   r   s    r   r!   CompatibilityFilesTests.files       t||,,r   c                 |    U R                  [        S U R                  R                  5        5       5      / SQ5        g )Nc              3   8   #    U  H  oR                   v   M     g 7fr   )name).0r   s     r   	<genexpr>>CompatibilityFilesTests.test_spec_path_iter.<locals>.<genexpr>   s     >)=99)=s   r   )assertEqualsortedr!   iterdirr"   s    r   test_spec_path_iter+CompatibilityFilesTests.test_spec_path_iter   s.    >););)=>>	
r   c                 p    U R                  [        U R                  S-  R                  5       5      / 5        g Nr   r+   listr!   r-   r"   s    r   test_child_path_iter,CompatibilityFilesTests.test_child_path_iter!   s)    tzzC/88:;R@r   c                     U R                  [        U R                  S-  S-  R                  5       5      / 5        U R                  [        U R                  S-  S-  S-  R                  5       5      / 5        g r1   r2   r"   s    r   test_orphan_path_iter-CompatibilityFilesTests.test_orphan_path_iter$   s_    tzzC/#5>>@A2FtzzC/#5;DDFGLr   c                     U R                  U R                  R                  5       5        U R                  U R                  R                  5       5        g r   assertFalser!   is_fileis_dirr"   s    r   test_spec_path_is)CompatibilityFilesTests.test_spec_path_is(   s8    ++-.**,-r   c                     U R                  U R                  S-  R                  5       5        U R                  U R                  S-  R	                  5       5        g r1   )
assertTruer!   r<   r;   r=   r"   s    r   test_child_path_is*CompatibilityFilesTests.test_child_path_is,   s@    c)2245$**s*2245r   c                    U R                  U R                  S-  S-  R                  5       5        U R                  U R                  S-  S-  R                  5       5        U R                  U R                  S-  S-  S-  R                  5       5        U R                  U R                  S-  S-  S-  R                  5       5        g r1   r:   r"   s    r   test_orphan_path_is+CompatibilityFilesTests.test_orphan_path_is0   s    $**s*S099;<$**s*S088:;$**s*S036??AB$**s*S036>>@Ar   c                 P    U R                  U R                  R                  S5        g )Ntestingpackager+   r!   r'   r"   s    r   test_spec_path_name+CompatibilityFilesTests.test_spec_path_name6   s    *:;r   c                 V    U R                  U R                  S-  R                  S5        g r1   rI   r"   s    r   test_child_path_name,CompatibilityFilesTests.test_child_path_name9   s!    $**s*00#6r   c                     U R                  U R                  S-  S-  R                  S5        U R                  U R                  S-  S-  S-  R                  S5        g Nr   r   r   rI   r"   s    r   test_orphan_path_name-CompatibilityFilesTests.test_orphan_path_name<   sO    $**s*S066<$**s*S036<<cBr   c                     U R                  U R                  R                  5       S5        U R                  U R                  R                  SS9S5        g )Nr   utf-8encodingHello, world!r+   r!   
read_bytes	read_textr"   s    r   test_spec_path_open+CompatibilityFilesTests.test_spec_path_open@   sB    ..02BC--w-?Qr   c                     U R                  U R                  S-  R                  5       S5        U R                  U R                  S-  R                  SS9S5        g )Nr   r   rT   rU   rW   rX   r"   s    r   test_child_path_open,CompatibilityFilesTests.test_child_path_openD   sO    $**s*668:JKZZ#(('(:O	
r   c                 F   U R                  [        5         U R                  S-  S-  R                  5         S S S 5        U R                  [        5         U R                  S-  S-  S-  R                  5         S S S 5        g ! , (       d  f       NP= f! , (       d  f       g = frP   )assertRaisesFileNotFoundErrorr!   rY   r"   s    r   test_orphan_path_open-CompatibilityFilesTests.test_orphan_path_openJ   sv    01ZZ##//1 201ZZ##c)557 21 2111s   !B$B
B
B c                     U R                  [        5         U R                  R                  S5        S S S 5        g ! , (       d  f       g = f)N0)ra   
ValueErrorr!   openr"   s    r   test_open_invalid_mode.CompatibilityFilesTests.test_open_invalid_modeP   s,    z*JJOOC  +**s	   ;
A	c                     U R                  [        5         [        R                  " 5         S S S 5        g ! , (       d  f       g = fr   )ra   rg   r   
OrphanPathr"   s    r   test_orphan_path_invalid0CompatibilityFilesTests.test_orphan_path_invalidT   s(    z*))+ +**s	   5
Ac                     [        U R                  5      nU R                  UR                  R	                  S 5      [
        5        g r   )r   r   assertIsInstanceloaderget_resource_readerr   )r   specs     r   test_wrap_spec&CompatibilityFilesTests.test_wrap_specX   s0    &dkk==dCEWXr    N)__name__
__module____qualname____firstlineno__propertyr   r!   r.   r4   r7   r>   rB   rE   rJ   rM   rQ   r[   r^   rc   ri   rm   rt   __static_attributes__rv   r   r   r   r      sy    
 
 - -
AM.6B<7CR
8!,Yr   r   c                   :    \ rS rSr\S 5       r\S 5       rS rSrg)CompatibilityFilesNoReaderTests]   c                 .    [         R                  " S 5      $ r   )r   create_package_from_loaderr"   s    r   r   'CompatibilityFilesNoReaderTests.package^   s    ..t44r   c                 B    [         R                  " U R                  5      $ r   r   r"   s    r   r!   %CompatibilityFilesNoReaderTests.filesb   r$   r   c                 ^    U R                  U R                  S-  [        R                  5        g r1   )rp   r!   r   rl   r"   s    r   test_spec_path_joinpath7CompatibilityFilesNoReaderTests.test_spec_path_joinpathf   s"    djj3.0B0M0MNr   rv   N)	rw   rx   ry   rz   r{   r   r!   r   r|   rv   r   r   r~   r~   ]   s.    5 5 - -Or   r~   )r   unittestimportlib_resourcesr    importlib_resources._adaptersr   r    r   TestCaser   r~   rv   r   r   <module>r      sC    	  '
 MYh// MY`
Oh&7&7 
Or   