← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/__pycache__/get.cpython-312.pyc

84 lines

�

c�bjQ��P�ddlmZddlmZddlZddlmZddlmZGd�d�Z	y)�)�md5)�productN)�make_path_posix)�GLOB_EDGE_CASES_TESTSc��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ejjed	ed
�d��Zd�Zd
�Zd�Zd�Zd�Zy)�AbstractGetTestsc��|}|}|j|�|j|�sJ�||d�}	||d�}
|j||d�|�|j|	�sJ�|j||dd�|�|j|
�sJ�|j	|	|
g�|j|	�rJ�|j|
�rJ�|j||d�|dz�|j|�sJ�|j|	�sJ�|j||dd�|dz�|j|
�sJ�y)N�file2�subfile1�subdir�/)�mkdir�isdir�get�isfile�rm�exists)�self�fs�fs_join�fs_bulk_operations_scenario_0�local_fs�
local_join�local_target�source�target�target_file2�target_subfile1s           �p/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/fsspec/tests/abstract/get.py�#test_get_file_to_existing_directoryz4AbstractGetTests.test_get_file_to_existing_directorys;��/�������v���~�~�f�%�%�%�!�&�'�2��$�V�Z�8��	���w�v�w�'��0����|�,�,�,�	���w�v�x��4�f�=�����/�/�/�	���\�?�3�4��?�?�<�0�0�0��?�?�?�3�3�3�	���w�v�w�'��#��6��~�~�f�%�%�%����|�,�,�,�
���w�v�x��4�f�s�l�C�����/�/�/�c��|}|}|j|�|j||dd�||d��|j|�sJ�|j||d��sJ�|j||dd��sJ�y)Nrrznewdir/�newdir�rrrr�	rrrrrrrrrs	         r�test_get_file_to_new_directoryz/AbstractGetTests.test_get_file_to_new_directory3s���/�������v��
����F�H�j�1�:�f�i�3P�	
��~�~�f�%�%�%��~�~�j���:�;�;�;����z�&�(�J�G�H�H�Hr!c��|}|}|j|�|j||dd�||d��|j||d��sJ�y)Nrr�newfile)rrrr%s	         r�+test_get_file_to_file_in_existing_directoryz<AbstractGetTests.test_get_file_to_file_in_existing_directoryJsQ��/�������v��
���w�v�x��4�j���6S�T����z�&�)�<�=�=�=r!c���|}|}|j|�|j||dd�||dd��|j||d��sJ�|j||dd��sJ�y)Nrrr#r(r$r%s	         r�&test_get_file_to_file_in_new_directoryz7AbstractGetTests.test_get_file_to_file_in_new_directory\st��/�������v��
����F�H�j�1��v�x��3�	
��~�~�j���:�;�;�;����z�&�(�I�F�G�G�Gr!c	�~�|}|}|j|�|j|�sJ�tddgddg�D�]\}	}
||d�}|	r|dz
}|
r|dzn|}|j||�|j	|�gk(sJ�|j||d��|	r�|j||d��sJ�|j||d��sJ�|j||d��sJ�|j||dd	��sJ�|j
||d��rJ�|j||d�||d�||d�gd��n�|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j||dd��sJ�|j||ddd	��sJ�|j||d�d��|j	|�gk(sJ�|j||dd
��|	r�|j||d��sJ�|j||d��sJ�|j
||d��rJ�|j
||d��rJ�|j||d�||d�gd��n�|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j
||dd��rJ�|j||d�d��|j	|�gk(r��J�y)NFTrr
��	recursiver�subfile2�	nesteddir�
nestedfile��r.�maxdepth)rr�zipr�lsrrr�
rrrrrrrrr�source_slash�target_slash�s�ts
             r�(test_get_directory_to_existing_directoryz9AbstractGetTests.test_get_directory_to_existing_directoryrsl��/�������v���~�~�f�%�%�%�*-�u�d�m�e�T�]�*K�&�L�,����)�A���S��� ,����&�A�
�F�F�1�a�L��;�;�v�&�"�,�,�,�
�F�F�1�a�4�F�(�����z�&�*�'E�F�F�F����z�&�*�'E�F�F�F��~�~�j���&E�F�F�F����z�&�+�|�'T�U�U�U�#�?�?�:�f�h�+G�H�H�H����"�6�:�6�"�6�:�6�"�6�;�7��
#�
�� �~�~�j���&B�C�C�C����z�&�(�J�'O�P�P�P����z�&�(�J�'O�P�P�P��~�~�j���;�&O�P�P�P�����v�x��l�K�������J�v�x�8�D��I��;�;�v�&�"�,�,�,�
�F�F�1�a�4�!�F�4�����z�&�*�'E�F�F�F����z�&�*�'E�F�F�F�#�?�?�:�f�k�+J�K�K�K�#�?�?�:�f�h�+G�H�H�H����"�6�:�6�"�6�:�6��#��� �~�~�j���&B�C�C�C����z�&�(�J�'O�P�P�P����z�&�(�J�'O�P�P�P�#�?�?�:�f�h��+T�U�U�U����J�v�x�8�D��I��;�;�v�&�"�,�,�,�{+Lr!c	�X�|}|}|j|�tddgddg�D�]\}	}
||d�}|	r|dz
}||d�}|
r|dz
}|j||�|j|�gk(sJ�|j||d��|j	||d��sJ�|j||dd��sJ�|j||dd��sJ�|j	||dd	��sJ�|j||dd	d
��sJ�|j
||d��rJ�|j||d�d��|j|�gk(sJ�|j||dd��|j	||d��sJ�|j||dd��sJ�|j||dd��sJ�|j
||dd	��rJ�|j
||d��rJ�|j||d�d��|j
||d��s��J�y)
NFTrr
r#r-rr/r0r1r2r3)rr5rr6rrrrr7s
             r�#test_get_directory_to_new_directoryz4AbstractGetTests.test_get_directory_to_new_directory�sD��/�������v��*-�u�d�m�e�T�]�*K�&�L�,����)�A���S����6�8�,�A���S���
�F�F�1�a�L��;�;�v�&�"�,�,�,�
�F�F�1�a�4�F�(��>�>�*�V�X�">�?�?�?��?�?�:�f�h�
�#K�L�L�L��?�?�:�f�h�
�#K�L�L�L��>�>�*�V�X�{�"K�L�L�L��?�?��6�8�[�,�G��
�� ���z�&�(�'C�D�D�D��K�K�
�6�8�4��K�E��;�;�v�&�"�,�,�,�
�F�F�1�a�4�!�F�4��>�>�*�V�X�">�?�?�?��?�?�:�f�h�
�#K�L�L�L��?�?�:�f�h�
�#K�L�L�L����z�&�(�K�'P�Q�Q�Q����z�&�(�'C�D�D�D��K�K�
�6�8�4��K�E����z�&�(�'C�D�D�D�G+Lr!c
�n�|}|}|j|�dD�]�}	|	r|dzn|}
|j||dd�|
�|j||d��sJ�|j||d��sJ�|j||d��rJ�|j	||dd��rJ�|j	||d��rJ�|j||d�||d�gd	�
�|j
|�gk(sJ�tddgd	dg�D�]�\}}|j||d|�|
|�
�|j||d��sJ�|j||d��sJ�|j||d��sJ�|j||dd��sJ�|j	||d��rJ�|j||d�||d�||d�gd	�
�|j
|�gk(sJ�|j||d|�|
|d
��|j||d��sJ�|j||d��sJ�|j	||d��rJ�|j	||d��rJ�|j||d�||d�gd	�
�|j
|�gk(r���J����y)N�FTr
r�*rr/r0r1Tr-�**Fr2r3)rrrrrrr6r5�
rrrrrrrrrr9r;�globr.s
             r�#test_get_glob_to_existing_directoryz4AbstractGetTests.test_get_glob_to_existing_directory�s���/�������v��)�L� ,����&�A�
�F�F�7�6�8�S�1�1�5��?�?�:�f�j�#A�B�B�B��?�?�:�f�j�#A�B�B�B��~�~�j���&E�F�F�F����z�&�+�|�'T�U�U�U����z�&�(�'C�D�D�D��K�K��v�z�2��v�z�2���
�
��;�;�v�&�"�,�,�,�$'��T�{�T�5�M�#B���i����w�v�x��6��Y��O����z�&�*�'E�F�F�F����z�&�*�'E�F�F�F��~�~�j���&E�F�F�F����z�&�+�|�'T�U�U�U�#�?�?�:�f�h�+G�H�H�H����"�6�:�6�"�6�:�6�"�6�;�7��
#�
�� �{�{�6�*�b�0�0�0�����F�H�d�3�Q�)�VW��� ���z�&�*�'E�F�F�F����z�&�*�'E�F�F�F�#�?�?�:�f�k�+J�K�K�K�#�?�?�:�f�h�+G�H�H�H����"�6�:�6�"�6�:�6��#��� �{�{�6�*�b�0�0�0�E$C�+*r!c
��|}|}|j|�dD�]:}	||d�}
|	r|
dz
}
|j||dd�|
�|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j	||dd��rJ�|j	||ddd	��rJ�|j	||d��rJ�|j	||dd��rJ�|j||d�d
��|j
|�gk(sJ�tddgd
d
g�D�]
\}}|j||d|�|
|��|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j||dd��sJ�|j||ddd	��sJ�|j	||d��rJ�|j	||dd��rJ�|j||d�d
��|j	||d��rJ�|j||d|�|
|d��|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j	||dd��rJ�|j	||d��rJ�|j	||dd��rJ�|j|j
|d
��d
��|j	||d��s��J���=y)Nr@r#r
rrArr/r0r1Tr-rBFr2r3)�detail)rrrrrrr6r5rCs
             r�test_get_glob_to_new_directoryz/AbstractGetTests.test_get_glob_to_new_directory=sr��/�������v��)�L����)�A���S���
�F�F�7�6�8�S�1�1�5��>�>�*�V�X�">�?�?�?��?�?�:�f�h�
�#K�L�L�L��?�?�:�f�h�
�#K�L�L�L����z�&�(�K�'P�Q�Q�Q�����6�8�[�,�G��
�� ���z�&�(�'C�D�D�D����z�&�(�H�'M�N�N�N��K�K�
�6�8�4��K�E��;�;�v�&�"�,�,�,�$'��T�{�T�5�M�#B���i����w�v�x��6��Y��O��~�~�j���&B�C�C�C����z�&�(�J�'O�P�P�P����z�&�(�J�'O�P�P�P��~�~�j���;�&O�P�P�P�����v�x��l�K����$�?�?�:�f�h�+G�H�H�H�#�?�?�:�f�h��+Q�R�R�R����J�v�x�8�D��I�#�?�?�:�f�h�+G�H�H�H�����F�H�d�3�Q�)�VW��� �~�~�j���&B�C�C�C����z�&�(�J�'O�P�P�P����z�&�(�J�'O�P�P�P�#�?�?�:�f�h��+T�U�U�U�#�?�?�:�f�h�+G�H�H�H�#�?�?�:�f�h��+Q�R�R�R����H�K�K��u�K�=���N�#�?�?�:�f�h�+G�H�H�H�7$C�+*r!�argnames�	argvaluesc���|}|
}tddgddg�D]�\}
}|j|�|
r	|	|d�n|}|r|dzn|}|j|||�|||��|j|�}|
r!|D�cgc]}t	|	|d|����}}n|D�cgc]}t	|	||����}}t|�t|�k(sJ�	|j
|d����ycc}wcc}w#t$rY��wxYw)NTFr#r
r3r-)rrr�findr�sortedr�FileNotFoundError)r�pathr.r4�expectedrr�fs_glob_edge_cases_filesrrrrr�new_dirr9r;�output�p�prefixed_expecteds                   r�test_get_glob_edge_casesz)AbstractGetTests.test_get_glob_edge_cases~s%��$*����%,�d�E�]�T�5�M�%J�!�G�\��N�N�6�"�07�
�6�8�,�V�A�'��C��Q�A��F�F�7�6�4�(�!�y�8�F�T��]�]�6�*�F��NV�%�NV��O�J�v�x��$C�D�h�"�%�
EM�%�DL�q�O�J�v�q�$9�:�H�"�%��&�>�V�,=�%>�>�>�>�
����F�d��3�)&K��%��%��%�
��
�s�5C!�C&�C+�+	C7�6C7c	���|}|}|j|�||d�||d�||dd�g}	dD]�}
|
r|dzn|}|j|	|�|j||d��sJ�|j||d��sJ�|j||d��sJ�|j||d�||d�||d�gd��|j	|�gk(r��J�y)	N�file1r
rrr@r
Tr-)rrrrr6)rrrrrrrrr�source_filesr9r;s            r�,test_get_list_of_files_to_existing_directoryz=AbstractGetTests.test_get_list_of_files_to_existing_directory�s��/�������v��
�F�G�$��F�G�$��F�H�j�1�
��*�L� ,����&�A��F�F�<��#��?�?�:�f�g�#>�?�?�?��?�?�:�f�g�#>�?�?�?��?�?�:�f�j�#A�B�B�B��K�K��v�w�/��v�w�/��v�z�2��
�

�
��;�;�v�&�"�,�,�,�!*r!c�r�|}|}|j|�||d�||d�||dd�g}	|j|	||d�dz�|j||d��sJ�|j||dd��sJ�|j||dd��sJ�|j||dd��sJ�y)NrXr
rrr#r
r$)
rrrrrrrrrrYs
          r�'test_get_list_of_files_to_new_directoryz8AbstractGetTests.test_get_list_of_files_to_new_directory�s���/�������v��
�F�G�$��F�G�$��F�H�j�1�
��	���|�Z���9�C�?�@��~�~�j���:�;�;�;����z�&�(�G�D�E�E�E����z�&�(�G�D�E�E�E����z�&�(�J�G�H�H�Hr!c�>�||d�}||d�}|j|�|j|�|}	|j|	�rJ�td�D]�}
|j	||	d��|j|	�sJ�|
dk(r5|j
||	d��sJ�|j||	d��s�bJ�|j
||	d��sJ�|j||	d��sJ�|j
||	dd��r��J�|j|	d��|j|	�rJ�td�D]`}
|j	|dz|	d��|j|	�sJ�|j
||	d��sJ�|j||	d��s�`J�y)N�src�file�Tr-rr
)r�touchr�rangerrrr)rrr�fs_pathrrrr^�src_filer�loops           r�test_get_directory_recursivez-AbstractGetTests.test_get_directory_recursive�s���
�g�u�%���3��'��
����
�
��������?�?�6�*�*�*��!�H�D��F�F�3��$�F�/��>�>�&�)�)�)��q�y����z�&�&�'A�B�B�B�#�?�?�:�f�e�+D�E�E�E����z�&�&�'A�B�B�B��~�~�j���&?�@�@�@����z�&�%��'H�I�I�I��	���F�d��+��?�?�6�*�*�*��!�H�D��F�F�3��9�f��F�5��>�>�&�)�)�)��?�?�:�f�f�#=�>�>�>����z�&�%�'@�A�A�A�	r!c���|}|}|j||d�|d��|j||d��sJ�|j||d��rJ�|j||d�g�|j|�gk(sJ�|j||d�|d��|j	||d��sJ�|j||dd��sJ�|j||d��sJ�y)NrTr-zsubfile.txtz
subdir.txtzsubdir*)rrrr6r)	rrrrrr�%fs_dir_and_file_with_same_name_prefixrrs	         r�6test_get_directory_without_files_with_same_name_prefixzGAbstractGetTests.test_get_directory_without_files_with_same_name_prefixs���7����	���w�v�x�(�&�D��A����z�&�-�@�A�A�A��?�?�:�f�l�#C�D�D�D����Z��
�6�7�8��{�{�6�"�b�(�(�(�	���w�v�y�)�6�T��B��~�~�j���:�;�;�;����z�&�(�M�J�K�K�K����z�&�,�?�@�@�@r!c
���|}|}g}	g}
td�D]r}tt|�jd��j	�}|	j|||�d���|
jt
|||�d�����t|j|	|
��td�D]5}|j|
|�jd�}
|
t|�k(r�5J�y)N�
zutf-8z.txt)�rpath�lpath)
rbr�str�encode�	hexdigest�appendrr�cat�decode)rrrrrr�fs_10_files_with_hashed_namesrrrY�destination_files�i�hashed_i�file_contents              r�,test_get_with_source_and_destination_as_listz=AbstractGetTests.test_get_with_source_and_destination_as_list/s���/���������r��A��3�q�6�=�=��1�2�<�<�>�H������8�*�D�0A� B�C��$�$��
�6�h�Z�t�3D� E�F�
��	���\�):��;��r��A�#�<�<�(9�!�(<�=�D�D�W�M�L��3�q�6�)�)�)�r!N)�__name__�
__module__�__qualname__r r&r)r+r<r>rErH�pytest�mark�parametrizerrVrZr\rfriry�r!rrr
s���&0�PI�.>�$H�,M-�^2E�hF1�P?I�B�[�[����j�)��k�*��(�	�(�T%-�NI�6"B�HA�:*r!r)
�hashlibr�	itertoolsrr}�fsspec.implementations.localr�fsspec.tests.abstract.commonrrr�r!r�<module>r�s ����
�8�>�A	*�A	*r!