Ë
    F^(hÅ'  ã                   ó’   — d dl Z d dlmZ d dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ  G d	„ d
«      Z G d„ de«      Zy)é    N)Úmd5©ÚLocalFileSystem)ÚAbstractCopyTests)ÚAbstractGetTests)ÚAbstractOpenTests)ÚAbstractPipeTests)ÚAbstractPutTestsc                   ó�  — e Zd ZdZej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Z	ej
                  d„ «       Z
ej
                  d„ «       Zej
                  d„ «       Zej
                  d	„ «       Zej
                  d
„ «       Zej
                  d„ «       Zd„ Zd„ Zd„ Zd„ Zy)ÚBaseAbstractFixtureszÀ
    Abstract base class containing fixtures that are used by but never need to
    be overridden in derived filesystem-specific classes to run the abstract
    tests on such filesystems.
    c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)z—
        Scenario on remote filesystem that is used for many cp/get/put tests.

        Cleans up at the end of each test it which it is used.
        T©Ú	recursiveN©Ú_bulk_operations_scenario_0Úrm©ÚselfÚfsÚfs_joinÚfs_pathÚsources        ú\/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/fsspec/tests/abstract/__init__.pyÚfs_bulk_operations_scenario_0z2BaseAbstractFixtures.fs_bulk_operations_scenario_0   s1   è ø€ ð ×1Ñ1°"°g¸wÓGˆØŠØ
�‰ˆf ˆÕ%ùó   ‚,.c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)z¢
        Scenario on remote filesystem that is used for glob edge cases cp/get/put tests.

        Cleans up at the end of each test it which it is used.
        Tr   N©Ú_glob_edge_cases_filesr   r   s        r   Úfs_glob_edge_cases_filesz-BaseAbstractFixtures.fs_glob_edge_cases_files    s1   è ø€ ð ×,Ñ,¨R°¸'ÓBˆØŠØ
�‰ˆf ˆÕ%ùr   c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)zË
        Scenario on remote filesystem that is used to check cp/get/put on directory
        and file with the same name prefixes.

        Cleans up at the end of each test it which it is used.
        Tr   N©Ú#_dir_and_file_with_same_name_prefixr   r   s        r   Ú%fs_dir_and_file_with_same_name_prefixz:BaseAbstractFixtures.fs_dir_and_file_with_same_name_prefix+   s1   è ø€ ð ×9Ñ9¸"¸gÀwÓOˆØŠØ
�‰ˆf ˆÕ%ùr   c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)zË
        Scenario on remote filesystem that is used to check cp/get/put files order
        when source and destination are lists.

        Cleans up at the end of each test it which it is used.
        Tr   N©Ú_10_files_with_hashed_namesr   r   s        r   Úfs_10_files_with_hashed_namesz2BaseAbstractFixtures.fs_10_files_with_hashed_names7   s1   è ø€ ð ×1Ñ1°"°g¸wÓGˆØŠØ
�‰ˆf ˆÕ%ùr   c              #   óp   K  —  ||d«      }|–— |j                  |«      r|j                  |d¬«       yy­w)z—
        Return name of remote directory that does not yet exist to copy into.

        Cleans up at the end of each test it which it is used.
        ÚtargetTr   N©Úexistsr   )r   r   r   r   r)   s        r   Ú	fs_targetzBaseAbstractFixtures.fs_targetC   s:   è ø€ ñ ˜ (Ó+ˆØŠØ�9‰9�VÔØ�E‰E�& DˆEÕ)ð ùó   ‚46c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)z–
        Scenario on local filesystem that is used for many cp/get/put tests.

        Cleans up at the end of each test it which it is used.
        Tr   Nr   ©r   Úlocal_fsÚ
local_joinÚ
local_pathr   s        r   Ú local_bulk_operations_scenario_0z5BaseAbstractFixtures.local_bulk_operations_scenario_0O   s1   è ø€ ð ×1Ñ1°(¸JÈ
ÓSˆØŠØ�‰�F dˆÕ+ùr   c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)z¡
        Scenario on local filesystem that is used for glob edge cases cp/get/put tests.

        Cleans up at the end of each test it which it is used.
        Tr   Nr   r/   s        r   Úlocal_glob_edge_cases_filesz0BaseAbstractFixtures.local_glob_edge_cases_filesZ   s1   è ø€ ð ×,Ñ,¨X°zÀ:ÓNˆØŠØ�‰�F dˆÕ+ùr   c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)zÊ
        Scenario on local filesystem that is used to check cp/get/put on directory
        and file with the same name prefixes.

        Cleans up at the end of each test it which it is used.
        Tr   Nr!   r/   s        r   Ú(local_dir_and_file_with_same_name_prefixz=BaseAbstractFixtures.local_dir_and_file_with_same_name_prefixe   s6   è ø€ ð ×9Ñ9Ø�j *ó
ˆð ŠØ�‰�F dˆÕ+ùr   c              #   ó`   K  — | j                  |||«      }|–— |j                  |d¬«       y­w)zÊ
        Scenario on local filesystem that is used to check cp/get/put files order
        when source and destination are lists.

        Cleans up at the end of each test it which it is used.
        Tr   Nr%   r/   s        r   Ú local_10_files_with_hashed_namesz5BaseAbstractFixtures.local_10_files_with_hashed_namesu   s1   è ø€ ð ×1Ñ1°(¸JÈ
ÓSˆØŠØ�‰�F dˆÕ+ùr   c              #   óp   K  —  ||d«      }|–— |j                  |«      r|j                  |d¬«       yy­w)z–
        Return name of local directory that does not yet exist to copy into.

        Cleans up at the end of each test it which it is used.
        r)   Tr   Nr*   )r   r0   r1   r2   r)   s        r   Úlocal_targetz!BaseAbstractFixtures.local_target�   s:   è ø€ ñ ˜J¨Ó1ˆØŠØ�?‰?˜6Ô"Ø�K‰K˜¨$ˆKÕ/ð #ùr-   c                 ót  —  ||d«      }|j                   ||d«      «       |j                   ||d«      «       t        d«      D ]p  } ||d|› �«      } ||d«      }|j                  |«       |j                   ||d«      «       |j                   ||d«      «       |j                   ||d	«      «       Œr |S )
uL  
        Scenario that is used for glob edge cases cp/get/put tests.
        Creates the following directory and file structure:

        ðŸ“� source
        â”œâ”€â”€ ðŸ“„ file1
        â”œâ”€â”€ ðŸ“„ file2
        â”œâ”€â”€ ðŸ“� subdir0
        â”‚   â”œâ”€â”€ ðŸ“„ subfile1
        â”‚   â”œâ”€â”€ ðŸ“„ subfile2
        â”‚   â””â”€â”€ ðŸ“� nesteddir
        â”‚       â””â”€â”€ ðŸ“„ nestedfile
        â””â”€â”€ ðŸ“� subdir1
            â”œâ”€â”€ ðŸ“„ subfile1
            â”œâ”€â”€ ðŸ“„ subfile2
            â””â”€â”€ ðŸ“� nesteddir
                â””â”€â”€ ðŸ“„ nestedfile
        r   Úfile1Úfile2é   ÚsubdirÚ	nesteddirÚsubfile1Úsubfile2Ú
nestedfile)ÚtouchÚrangeÚmakedirs)r   Úsome_fsÚ	some_joinÚ	some_pathr   Ú
subdir_idxr@   rA   s           r   r   z+BaseAbstractFixtures._glob_edge_cases_files�   s¶   € ñ& ˜9 hÓ/ˆØ�‰‘i ¨Ó0Ô1Ø�‰‘i ¨Ó0Ô1ä ›(ò 	>ˆJÙ˜v¨°
¨|Ð'<Ó=ˆFÙ! &¨+Ó6ˆIØ×Ñ˜YÔ'Ø�M‰M™) F¨JÓ7Ô8Ø�M‰M™) F¨JÓ7Ô8Ø�M‰M™) I¨|Ó<Õ=ð	>ð ˆó    c                 óN  —  ||d«      } ||d«      } ||d«      }|j                  |«       |j                   ||d«      «       |j                   ||d«      «       |j                   ||d«      «       |j                   ||d«      «       |j                   ||d«      «       |S )	u‚  
        Scenario that is used for many cp/get/put tests. Creates the following
        directory and file structure:

        ðŸ“� source
        â”œâ”€â”€ ðŸ“„ file1
        â”œâ”€â”€ ðŸ“„ file2
        â””â”€â”€ ðŸ“� subdir
            â”œâ”€â”€ ðŸ“„ subfile1
            â”œâ”€â”€ ðŸ“„ subfile2
            â””â”€â”€ ðŸ“� nesteddir
                â””â”€â”€ ðŸ“„ nestedfile
        r   r@   rA   r=   r>   rB   rC   rD   ©rG   rE   )r   rH   rI   rJ   r   r@   rA   s          r   r   z0BaseAbstractFixtures._bulk_operations_scenario_0®   sš   € ñ ˜9 hÓ/ˆÙ˜6 8Ó,ˆÙ˜f kÓ2ˆ	Ø×Ñ˜Ô#Ø�‰‘i ¨Ó0Ô1Ø�‰‘i ¨Ó0Ô1Ø�‰‘i ¨
Ó3Ô4Ø�‰‘i ¨
Ó3Ô4Ø�‰‘i 	¨<Ó8Ô9ØˆrL   c                 ó´   —  ||d«      } ||d«      } ||d«      } ||d«      }|j                  |«       |j                  |«       |j                  |«       |S )u&  
        Scenario that is used to check cp/get/put on directory and file with
        the same name prefixes. Creates the following directory and file structure:

        ðŸ“� source
        â”œâ”€â”€ ðŸ“„ subdir.txt
        â””â”€â”€ ðŸ“� subdir
            â””â”€â”€ ðŸ“„ subfile.txt
        r   r@   z
subdir.txtzsubfile.txtrN   )r   rH   rI   rJ   r   r@   ÚfileÚsubfiles           r   r"   z8BaseAbstractFixtures._dir_and_file_with_same_name_prefixÇ   s_   € ñ ˜9 hÓ/ˆÙ˜6 8Ó,ˆÙ˜ Ó.ˆÙ˜F MÓ2ˆØ×Ñ˜Ô Ø�‰�dÔØ�‰�gÔØˆrL   c                 óö   —  ||d«      }t        d«      D ]a  }t        t        |«      j                  d«      «      j	                  «       } |||› d�«      }|j                  ||› j                  «       ¬«       Œc |S )uê   
        Scenario that is used to check cp/get/put files order when source and
        destination are lists. Creates the following directory and file structure:

        ðŸ“� source
        â””â”€â”€ ðŸ“„ {hashed([0-9])}.txt
        r   é
   zutf-8z.txt)ÚpathÚvalue)rF   r   ÚstrÚencodeÚ	hexdigestÚpipe)r   rH   rI   rJ   r   ÚiÚhashed_irT   s           r   r&   z0BaseAbstractFixtures._10_files_with_hashed_namesÚ   su   € ñ ˜9 hÓ/ˆÜ�r“ò 	;ˆAÜœ3˜q›6Ÿ=™=¨Ó1Ó2×<Ñ<Ó>ˆHÙ˜V¨ z°Ð%6Ó7ˆDØ�L‰L˜d¨Q¨C¯-©-«/ˆLÕ:ð	;ð ˆrL   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚpytestÚfixturer   r   r#   r'   r,   r3   r5   r7   r9   r;   r   r   r"   r&   © rL   r   r   r      s  „ ñð ‡^�^ñ&ó ð&ð ‡^�^ñ&ó ð&ð ‡^�^ñ	&ó ð	&ð ‡^�^ñ	&ó ð	&ð ‡^�^ñ	*ó ð	*ð ‡^�^ñ,ó ð,ð ‡^�^ñ,ó ð,ð ‡^�^ñ,ó ð,ð ‡^�^ñ	,ó ð	,ð ‡^�^ñ	0ó ð	0òòBò2ó&rL   r   c                   ó>  — e Zd ZdZej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Z ej
                  d¬«      d„ «       Z	ej
                  d„ «       Z
ej
                  d	„ «       Zej
                  d
„ «       Zej
                  d„ «       Zy)ÚAbstractFixturesa}  
    Abstract base class containing fixtures that may be overridden in derived
    filesystem-specific classes to run the abstract tests on such filesystems.

    For any particular filesystem some of these fixtures must be overridden,
    such as ``fs`` and ``fs_path``, and others may be overridden if the
    default functions here are not appropriate, such as ``fs_join``.
    c                 ó   — t        d«      ‚©Nz3This function must be overridden in derived classes©ÚNotImplementedError©r   s    r   r   zAbstractFixtures.fsô   ó   € ä!Ð"WÓXÐXrL   c                 ó6   — t         j                  j                  S )zâ
        Return a function that joins its arguments together into a path.

        Most fsspec implementations join paths in a platform-dependent way,
        but some will override this to always use a forward slash.
        ©ÚosrT   Újoinri   s    r   r   zAbstractFixtures.fs_joinø   s   € ô �w‰w�|‰|ÐrL   c                 ó   — t        d«      ‚rf   rg   ri   s    r   r   zAbstractFixtures.fs_path  rj   rL   Úclass)Úscopec                 ó   — t        d¬«      S )NT)Ú
auto_mkdirr   ri   s    r   r0   zAbstractFixtures.local_fs  s   € ô ¨$Ô/Ð/rL   c                 ó6   — t         j                  j                  S )zs
        Return a function that joins its arguments together into a path, on
        the local filesystem.
        rl   ri   s    r   r1   zAbstractFixtures.local_join  s   € ô �w‰w�|‰|ÐrL   c                 ó   — |S ©Nrb   )r   Útmpdirs     r   r2   zAbstractFixtures.local_path  s   € àˆrL   c                  ó   — y)zP
        Return whether this implementation supports empty directories.
        Trb   ri   s    r   Úsupports_empty_directoriesz+AbstractFixtures.supports_empty_directories  s   € ð
 rL   c                 ó   — d„ S )Nc                 ó   — | S rv   rb   )Úxs    r   ú<lambda>z3AbstractFixtures.fs_sanitize_path.<locals>.<lambda>!  s   € ˜€ rL   rb   ri   s    r   Úfs_sanitize_pathz!AbstractFixtures.fs_sanitize_path  s   € áÐrL   N)r\   r]   r^   r_   r`   ra   r   r   r   r0   r1   r2   ry   r~   rb   rL   r   rd   rd   ê   sÒ   „ ñð ‡^�^ñYó ðYð ‡^�^ñó ðð ‡^�^ñYó ðYð €V‡^�^˜'Ô"ñ0ó #ð0ð
 ‡^�^ñó ðð ‡^�^ñó ðð ‡^�^ñó ðð ‡^�^ñó ñrL   rd   )rm   Úhashlibr   r`   Úfsspec.implementations.localr   Úfsspec.tests.abstract.copyr   Úfsspec.tests.abstract.getr   Úfsspec.tests.abstract.openr   Úfsspec.tests.abstract.piper	   Úfsspec.tests.abstract.putr
   r   rd   rb   rL   r   ú<module>r†      s:   ðÛ 	Ý ã å 8Ý 8Ý 6Ý 8Ý 8Ý 6÷Yñ Yôx7Ð+õ 7rL   