§
    dŠtjÕ'  ã                   ó    — 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dS )é    N)Úmd5©ÚLocalFileSystem)ÚAbstractCopyTests)ÚAbstractGetTests)ÚAbstractOpenTests)ÚAbstractPipeTests)ÚAbstractPutTestsc                   ój  — 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dS )Ú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              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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/html/CA-Chatbot/venv/lib/python3.11/site-packages/fsspec/tests/abstract/__init__.pyÚfs_bulk_operations_scenario_0z2BaseAbstractFixtures.fs_bulk_operations_scenario_0   sD   è è € ð ×1Ò1°"°g¸wÑGÔGˆØˆˆˆØ
�Šˆf ˆÑ%Ô%Ð%Ð%Ð%ó    c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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    sD   è è € ð ×,Ò,¨R°¸'ÑBÔBˆØˆˆˆØ
�Šˆf ˆÑ%Ô%Ð%Ð%Ð%r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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+   sD   è è € ð ×9Ò9¸"¸gÀwÑOÔOˆØˆˆˆØ
�Šˆf ˆÑ%Ô%Ð%Ð%Ð%r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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   sD   è è € ð ×1Ò1°"°g¸wÑGÔGˆØˆˆˆØ
�Šˆf ˆÑ%Ô%Ð%Ð%Ð%r   c              #   ó†   K  —  ||d¦  «        }|V — |                      |¦  «        r|                     |d¬¦  «         dS dS )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Ñ)Ô)Ð)Ð)Ð)ð	*ð 	*r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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   sD   è è € ð ×1Ò1°(¸JÈ
ÑSÔSˆØˆˆˆØ�Š�F dˆÑ+Ô+Ð+Ð+Ð+r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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   sD   è è € ð ×,Ò,¨X°zÀ:ÑNÔNˆØˆˆˆØ�Š�F dˆÑ+Ô+Ð+Ð+Ð+r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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   sK   è è € ð ×9Ò9Ø�j *ñ
ô 
ˆð ˆˆˆØ�Š�F dˆÑ+Ô+Ð+Ð+Ð+r   c              #   ón   K  — |                       |||¦  «        }|V — |                     |d¬¦  «         dS )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   sD   è è € ð ×1Ò1°(¸JÈ
ÑSÔSˆØˆˆˆØ�Š�F dˆÑ+Ô+Ð+Ð+Ð+r   c              #   ó†   K  —  ||d¦  «        }|V — |                      |¦  «        r|                     |d¬¦  «         dS dS )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   r/   r0   r1   r)   s        r   Úlocal_targetz!BaseAbstractFixtures.local_target�   s\   è è € ð �˜J¨Ñ1Ô1ˆØˆˆˆØ�?Š?˜6Ñ"Ô"ð 	0Ø�KŠK˜¨$ˆKÑ/Ô/Ð/Ð/Ð/ð	0ð 	0r   c                 óØ  —  ||d¦  «        }|                       ||d¦  «        ¦  «         |                       ||d¦  «        ¦  «         t          d¦  «        D ]�} ||d|› �¦  «        } ||d¦  «        }|                     |¦  «         |                       ||d¦  «        ¦  «         |                       ||d¦  «        ¦  «         |                       ||d	¦  «        ¦  «         Œ�|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?   r@   s           r   r   z+BaseAbstractFixtures._glob_edge_cases_files�   s  € ð& �˜9 hÑ/Ô/ˆØ�Š�i�i ¨Ñ0Ô0Ñ1Ô1Ð1Ø�Š�i�i ¨Ñ0Ô0Ñ1Ô1Ð1å ™(œ(ð 	>ð 	>ˆJØ�Y˜vÐ'<°
Ð'<Ð'<Ñ=Ô=ˆFØ!˜	 &¨+Ñ6Ô6ˆIØ×Ò˜YÑ'Ô'Ð'Ø�MŠM˜)˜) F¨JÑ7Ô7Ñ8Ô8Ð8Ø�MŠM˜)˜) F¨JÑ7Ô7Ñ8Ô8Ð8Ø�MŠM˜)˜) I¨|Ñ<Ô<Ñ=Ô=Ð=Ð=àˆr   c                 ó®  —  ||d¦  «        } ||d¦  «        } ||d¦  «        }|                      |¦  «         |                      ||d¦  «        ¦  «         |                      ||d¦  «        ¦  «         |                      ||d¦  «        ¦  «         |                      ||d¦  «        ¦  «         |                      ||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?   r@   r<   r=   rA   rB   rC   ©rF   rD   )r   rG   rH   rI   r   r?   r@   s          r   r   z0BaseAbstractFixtures._bulk_operations_scenario_0®   sæ   € ð �˜9 hÑ/Ô/ˆØ�˜6 8Ñ,Ô,ˆØ�I˜f kÑ2Ô2ˆ	Ø×Ò˜Ñ#Ô#Ð#Ø�Š�i�i ¨Ñ0Ô0Ñ1Ô1Ð1Ø�Š�i�i ¨Ñ0Ô0Ñ1Ô1Ð1Ø�Š�i�i ¨
Ñ3Ô3Ñ4Ô4Ð4Ø�Š�i�i ¨
Ñ3Ô3Ñ4Ô4Ð4Ø�Š�i�i 	¨<Ñ8Ô8Ñ9Ô9Ð9Øˆr   c                 óä   —  ||d¦  «        } ||d¦  «        } ||d¦  «        } ||d¦  «        }|                      |¦  «         |                     |¦  «         |                     |¦  «         |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.txtrL   )r   rG   rH   rI   r   r?   ÚfileÚsubfiles           r   r"   z8BaseAbstractFixtures._dir_and_file_with_same_name_prefixÇ   s…   € ð �˜9 hÑ/Ô/ˆØ�˜6 8Ñ,Ô,ˆØˆy˜ Ñ.Ô.ˆØ�)˜F MÑ2Ô2ˆØ×Ò˜Ñ Ô Ð Ø�Š�dÑÔÐØ�Š�gÑÔÐØˆr   c                 ó6  —  ||d¦  «        }t          d¦  «        D ]|}t          t          |¦  «                             d¦  «        ¦  «                             ¦   «         } |||› d�¦  «        }|                     ||›                      ¦   «         ¬¦  «         Œ}|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)rE   r   ÚstrÚencodeÚ	hexdigestÚpipe)r   rG   rH   rI   r   ÚiÚhashed_irR   s           r   r&   z0BaseAbstractFixtures._10_files_with_hashed_namesÚ   s—   € ð �˜9 hÑ/Ô/ˆÝ�r‘”ð 	;ð 	;ˆAÝ�3˜q™6œ6Ÿ=š=¨Ñ1Ô1Ñ2Ô2×<Ò<Ñ>Ô>ˆHØ�9˜V¨Ð%6Ð%6Ð%6Ñ7Ô7ˆDØ�LŠL˜d¨Q¨&¯-ª-©/¬/ˆLÑ:Ô:Ð:Ð:Øˆr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚpytestÚfixturer   r   r#   r'   r,   r2   r4   r6   r8   r:   r   r   r"   r&   © r   r   r   r      s}  € € € € € ðð ð „^ð&ð &ñ „^ð&ð „^ð&ð &ñ „^ð&ð „^ð	&ð 	&ñ „^ð	&ð „^ð	&ð 	&ñ „^ð	&ð „^ð	*ð 	*ñ „^ð	*ð „^ð,ð ,ñ „^ð,ð „^ð,ð ,ñ „^ð,ð „^ð,ð ,ñ „^ð,ð „^ð	,ð 	,ñ „^ð	,ð „^ð	0ð 	0ñ „^ð	0ðð ð ðBð ð ð2ð ð ð&ð ð ð ð r   r   c                   ó6  — e Zd ZdZej        d„ ¦   «         Zej        d„ ¦   «         Zej        d„ ¦   «         Z ej        d¬¦  «        e	d„ ¦   «         ¦   «         Z
ej        d„ ¦   «         Zej        d	„ ¦   «         Zej        d
„ ¦   «         Zej        d„ ¦   «         ZdS )Ú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ÔXÐXr   c                 ó$   — 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.
        ©ÚosrR   Újoinrg   s    r   r   zAbstractFixtures.fs_joinø   s   € õ ŒwŒ|Ðr   c                 ó    — t          d¦  «        ‚rd   re   rg   s    r   r   zAbstractFixtures.fs_path  rh   r   Úclass)Úscopec                 ó"   — t          d¬¦  «        S )NT)Ú
auto_mkdirr   )Úclss    r   r/   zAbstractFixtures.local_fs  s   € õ
 ¨$Ð/Ñ/Ô/Ð/r   c                 ó$   — t           j        j        S )zs
        Return a function that joins its arguments together into a path, on
        the local filesystem.
        rj   rg   s    r   r0   zAbstractFixtures.local_join  s   € õ ŒwŒ|Ðr   c                 ó   — |S ©Nr`   )r   Útmpdirs     r   r1   zAbstractFixtures.local_path  s   € àˆr   c                 ó   — dS )zP
        Return whether this implementation supports empty directories.
        Tr`   rg   s    r   Úsupports_empty_directoriesz+AbstractFixtures.supports_empty_directories  s	   € ð
 ˆtr   c                 ó   — d„ S )Nc                 ó   — | S ru   r`   )Úxs    r   ú<lambda>z3AbstractFixtures.fs_sanitize_path.<locals>.<lambda>"  s   € ˜€ r   r`   rg   s    r   Úfs_sanitize_pathz!AbstractFixtures.fs_sanitize_path   s
   € àˆ{Ðr   N)rZ   r[   r\   r]   r^   r_   r   r   r   Úclassmethodr/   r0   r1   rx   r}   r`   r   r   rb   rb   ê   s$  € € € € € ðð ð „^ðYð Yñ „^ðYð „^ðð ñ „^ðð „^ðYð Yñ „^ðYð €V„^˜'Ð"Ñ"Ô"Øð0ð 0ñ „[ñ #Ô"ð0ð
 „^ðð ñ „^ðð „^ðð ñ „^ðð „^ðð ñ „^ðð „^ðð ñ „^ðð ð r   rb   )rk   Ú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   rb   r`   r   r   ú<module>r†      sû   ðØ 	€	€	€	Ø Ð Ð Ð Ð Ð à €€€à 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6ðYð Yð Yð Yð Yñ Yô Yð Yðx8ð 8ð 8ð 8ð 8Ð+ñ 8ô 8ð 8ð 8ð 8r   