← back to Atmos Game

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

75 lines

�

c�bjv
���ddlZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
Z
ddlZe
j�d��Z
Gd�d�Ze
jdd�	�d
eeddffd��Ze
jd��d
��Zy)�N)�deque)�	Generator�Sequencec#�$K�tjd�}|jj�|jj�|jjd�	|��|jj�|jj�|jjd�y#|jj�|jj�|jjd�wxYw�w)z0
    Fixture providing a memory filesystem.
    �memory�N)�fsspec�
filesystem�store�clear�pseudo_dirs�append)�ms �f/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/fsspec/conftest.pyrrs�����
	���(�#�A��G�G�M�M�O��M�M�����M�M�����!���	���
�
��	�
�
����	�
�
���R� ��	
���
�
��	�
�
����	�
�
���R� �s �A%D�(B<�,AD�<AD
�
Dc�8�eZdZdZd	d�Zdd�dedeeeffd�Z	y)
�InstanceCacheInspectorzQ
    Helper class to inspect instance caches of filesystem classes in tests.
    �returnNc���ttjjg�}|rC|j	�}|j�|j
|j��|r�Byy)zU
        Clear instance caches of all currently imported filesystem classes.
        N)rr	�spec�AbstractFileSystem�popleft�clear_instance_cache�extend�__subclasses__)�self�classes�clss   rrzInstanceCacheInspector.clear$sP������7�7�8�9����/�/�#�C��$�$�&��N�N�3�-�-�/�0��T)�	omit_zerorc��i}ttjjg�}|r�|j	�}t|j�}t|jttf�r>t|jt�r|jn|jd}|s|s|||<|j|j��|r��|S)a
        Gather counts of filesystem instances in the instance caches
        of all currently imported filesystem classes.

        Parameters
        ----------
        omit_zero:
            Whether to omit instance types with no cached instances.
        r)
rr	rrr�len�_cache�
isinstance�protocolr�strrr)rr�outrr�count�keys       r�
gather_countsz$InstanceCacheInspector.gather_counts.s���!������7�7�8�9����/�/�#�C���
�
�O�E��#�,�,��3��8�&0����s�&C�c�l�l����VW����	�$�C��H��N�N�3�-�-�/�0���
r)rN)
�__name__�
__module__�__qualname__�__doc__r�bool�dictr%�intr)�rrrrs,���1�26��$��$�s�C�x�.�rr�functionT)�scope�autouserc#�K�t�}|j�	|��|j�y#|j�wxYw�w)as
    Fixture to ensure empty filesystem instance caches before and after a test.

    Used by default for all tests.
    Clears caches of all imported filesystem classes.
    Can be used to write test assertions about instance caches.

    Usage:

        def test_something(instance_caches):
            # Test code here
            fsspec.open("file://abc")
            fsspec.open("memory://foo/bar")

            # Test assertion
            assert instance_caches.gather_counts() == {"file": 1, "memory": 1}

    Returns
    -------
    instance_caches: An instance cache inspector for clearing and inspecting caches.
    N)rr)�ics r�instance_cachesr7Gs5����.
 �	!�B��H�H�J����
���
�����
�s�A�3�A�A�A)r3c#�K�tjd�t|�}ttj
j
|d�d�5}|jddz�ddd�tjtjddd|d	d
ddd
g
�}	tjd�d��|j�|j�	t!j"|�y#1swY��xYw#t$$rYywxYw#|j�|j�	t!j"|�w#t$$rYwwxYwxYw�w)z6
    Fixture providing a writable FTP filesystem.
    �	pyftpdlibr&�wbshelloi'Nz-mz-dz-u�userz-P�passz-w�)�	localhostiIr;r<)�pytest�importorskipr%�open�os�path�join�write�
subprocess�Popen�sys�
executable�time�sleep�	terminate�wait�shutil�rmtree�	Exception)�tmpdir�d�f�Ps    r�ftp_writablerUgs����
����$��F��A�	
�b�g�g�l�l�1�e�$�d�	+�q�	����5� �!�
,����	����{�D�!�T�6�4��QU�V�	�A�	��
�
�1�
�/�/�	���
�	����	��M�M�&�!�
,�	+���	��	��		
���
�	����	��M�M�&�!���	��	�s~�AE
�
C(�"5E
�D�1 E
�C4�'E
�(C1�-E
�4	D�=E
�?D�E
�!E
�%D;�:E
�;	E�E
�E�E
�
E
)rBrNrFrHrJ�collectionsr�collections.abcrrr?r	�fixturerrr7rUr1rr�<module>rYs���	�
��
���/�
�
������
!��
!� %�%�P����j�$�/���#9�4��#E�F��0��>����j�!��"�r