Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_getpath.cpython-312.opt-1.pyc

�

'Μgr����ddlZddlZddlZddlZddlZddlmZ	eje�j�jjjdzj�ZGd�dej �Zed>idd�d	d�d
d�dd�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd��Zed>id d�d!d�d"d�d#d�d$d�d%d�d&d�d'd�d(d�d)d�d*d�d+d�d,d�d-d�d.d�d/d�d0d�d1d�d2d3�d4d3��ZGd5�d6e�ZGd7�d8�ZGd9�d:e�Zd?d;�Zd?d<�Zd=�Zy#e
$rddlmZe�ZY��wxYw)@�N)�verbosezModules/getpath.py)�get_getpath_codeobjectc���eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�MockGetPathTestsc�2��t�|�|i|��d|_y�N)�super�__init__�maxDiff)�self�a�kw�	__class__s   ��./usr/local/lib/python3.12/test/test_getpath.pyr
zMockGetPathTests.__init__s���
���!�"�r�"����c	���tdd��}|jd�|jd�|jd�t	dddddgd���}t||�}|j
||�y	)
z,Test a 'standard' install layout on Windows.�C:\Python\python.exe��argv0�real_executable�C:\Python\Lib\os.py�C:\Python\DLLs�	C:\Python���C:\Python\python98.zipr�
C:\Python\Libr��
executable�base_executable�prefix�exec_prefix�module_search_paths_set�module_search_pathsN��MockNTNamespace�add_known_xfile�add_known_file�
add_known_dir�dict�getpath�assertEqual�r�ns�expected�actuals    r�test_normal_win32z"MockGetPathTests.test_normal_win32s}��
�)�3�
��	���2�3�
���0�1�
���*�+��.�3��$�$%�!�

����X�&������6�*rc���tdd��}|jd�|jd�|jddg�tdddddddgd��	�}t	||�}|j||�y
)z(Test an in-build-tree layout on Windows.�#C:\CPython\PCbuild\amd64\python.exer�C:\CPython\Lib\os.py�'C:\CPython\PCbuild\amd64\pybuilddir.txt��
C:\CPythonr�z%C:\CPython\PCbuild\amd64\python98.zipzC:\CPython\PCbuild\amd64�C:\CPython\Lib�rr r!r"�build_prefix�_is_python_buildr#r$N�r&r'r(r*r+r,r-s    r�test_buildtree_win32z%MockGetPathTests.test_buildtree_win320s���
�8�B�
��	���A�B�
���1�2�
���D�r�d�K��=�B� �%�&��$%�!�

����X�&������6�*rc�4�tddd��}|jd�|jd�|jd�|jd�|jddg�t	ddddddd	gd
���}t||�}|j
||�y)
z�Test a venv layout on Windows.

        This layout is discovered by the presence of %__PYVENV_LAUNCHER__%,
        specifying the original launcher executable. site.py is responsible
        for updating prefix and exec_prefix.
        rzC:\venv\Scripts\python.exe)r�ENV___PYVENV_LAUNCHER__rrrzC:\venv\pyvenv.cfgzhome = C:\Pythonrrr�rr!r"r �base_prefix�base_exec_prefixr#r$Nr%r-s    r�test_venv_win32z MockGetPathTests.test_venv_win32Js����)�$A�3�
��
	���2�3�
���8�9�
���0�1�
���*�+�
���/��2
�	��4��$�3�$�)�$%�!�
����X�&������6�*rc��d}t|d|�d�d|�d�di�}tdd|��}|jd�|jd	�|j	d
�tdgd��
�}t
||�}|j||�d|dd<d|dd<d|dd<tdgd��
�}t
||�}|j||�y)z�Test registry lookup on Windows.

        On Windows there are registry entries that are intended for other
        applications to register search paths.
        z1HKLM\Software\Python\PythonCore\9.8-XY\PythonPathNz\Path1�	path1-dirz
\Path1\Subdirznot-subdirsr)rr�winregrrr)rrFrrr)r#r$r�config�use_environmentr#r$r)�
MockWinregr&r'r(r)r*r+r,)r�hkeyrGr.r/r0s      r�test_registry_win32z$MockGetPathTests.test_registry_win32os��D����$��f�G��k��f�O�$�m�
���
�)�3��
��
	���2�3�
���0�1�
���*�+��$%�!�

����X�&������6�*�*+��8��&�'�23��8��.�/�.2��8��*�+��$%�!�
����X�&������6�*rc	�,�tdd��}|jd�|jd�|jdd�|jd�|j	d�tdddddgd��	�}t
||�}|j||�y
)z8Test a 'standard' install layout via symlink on Windows.�C:\LinkedFrom\python.exerrrrrrrrN)r&r'�add_known_linkr(r)r*r+r,r-s    r�test_symlink_normal_win32z*MockGetPathTests.test_symlink_normal_win32�s���
�-�3�
��	���6�7�
���2�3�
���5�7N�O�
���0�1�
���*�+��2�7��$�$%�!�

����X�&������6�*rc�4�tdd��}|jd�|jd�|jdd�|jd�|jddg�t	dddddddgd	��
�}t||�}|j
||�y)z4Test an in-build-tree layout via symlink on Windows.rNr3rr4r5r6r7rr8r:N)r&r'rOr(r*r+r,r-s    r�test_symlink_buildtree_win32z-MockGetPathTests.test_symlink_buildtree_win32�s���
�-�B�
��	���6�7�
���A�B�
���5�7]�^�
���1�2�
���D�r�d�K��2�7� �%�&��$%�!�

����X�&������6�*rc���tddd��}|jd�|jd�|jddg�tdddddddgd	��
�}t	||�}|j||�y)zETest an out-of-build-tree layout on Windows with PYTHONHOME override.zC:\Out\python.exer7)rr�ENV_PYTHONHOMEr4zC:\Out\pybuilddir.txtr6zC:\r)zC:\Out\python98.zipzC:\Outr9r:Nr=r-s    r�test_buildtree_pythonhome_win32z0MockGetPathTests.test_buildtree_pythonhome_win32�s���
�&�0�(�
��
	���/�0�
���1�2�
���2�R�D�9��+�0� �%� ��$%�!�
��"��X�&������6�*rc	���tdd��}|jd�|jd�tdddddgd���}t	||�}|j||�y)	z0Test a layout on Windows with no DLLs directory.rrrrr)rrrrNr=r-s    r�test_no_dlls_win32z#MockGetPathTests.test_no_dlls_win32�sn��
�)�3�
��	���2�3�
���0�1��.�3��$�$%�!�

����X�&������6�*rc	���tddd��}|jd�|jd�|jd�t	dddddgd	��
�}t||�}|j
||�y)z(Test a 'standard' install layout on *nix�/usr�pythonz/usr/bin)�PREFIXr�ENV_PATH�/usr/bin/python�/usr/lib/python9.8/os.py�/usr/lib/python9.8/lib-dynloadr�z/usr/lib/python98.zipz/usr/lib/python9.8r_rN��MockPosixNamespacer'r(r)r*r+r,r-s    r�test_normal_posixz"MockGetPathTests.test_normal_posixs���
����
��
	���,�-�
���4�5�
���9�:��(�-���$%�!�

����X�&������6�*rc�2�tdd��}|jd�|jd�|jddg�|jd�|jd�t	ddddd	d
d
gd���}t||�}|j
||�y
)��Test an in-build-tree layout on POSIX.

        This layout is discovered from the presence of pybuilddir.txt, which
        contains the relative path from the executable's directory to the
        platstdlib path.
        �/home/cpython/python�
/usr/local�rr[�/usr/local/bin/python�/home/cpython/pybuilddir.txt�build/lib.linux-x86_64-9.8�/home/cpython/Lib/os.py�/home/cpython/lib-dynload�
/home/cpythonr��/usr/local/lib/python98.zip�/home/cpython/Libz(/home/cpython/build/lib.linux-x86_64-9.8�rr!r"r r;r<r#r$Nrar-s    r�test_buildpath_posixz%MockGetPathTests.test_buildpath_posix%s��� �)��
��	���1�2�
���2�3�
���8�;W�:X�Y�
���3�4�
���4�5��-��$�2�(��$%�!�

����X�&������6�*rc�4�tddd��}|jd�|jd�|jd�|jd�|jd	d
g�t	dddddddgd��
�}t||�}|j
||�y)�Test a venv layout on *nix.rZrY�/venv/bin:/usr/bin�rr[r\r]�/venv/bin/pythonr^r_�/venv/pyvenv.cfg�home = /usr/binrr`rANrar-s    r�test_venv_posixz MockGetPathTests.test_venv_posixFs���
���)�
��
	���,�-�
���-�.�
���4�5�
���9�:�
���,��/
�	��)���-��#�$%�!�

����X�&������6�*rc�X�tddd��}|jd�|jd�|jdd�|jd�|j	d�|jd	d
g�tdddddddgd��
�}t
||�}|j||�y)rurZrYrvrwz/usr/bin/python3rxr^r_ryrzrr`rAN�rbr'rOr(r)r*r+r,r-s    r�test_venv_changed_name_posixz-MockGetPathTests.test_venv_changed_name_posixes���
���)�
��
	���-�.�
���-�.�
���,�.@�A�
���4�5�
���9�:�
���,��/
�	��)���.��#�$%�!�

����X�&������6�*rc�X�tddd��}|jd�|jd�|jdd�|jd�|j	d�|jdd	g�tdd
d
dd
d
dgd��
�}t
||�}|j||�y)zCTest a venv created from non-installed python has correct zip path.rxrYrvrwz!/path/to/non-installed/bin/pythonz*/path/to/non-installed/lib/python9.8/os.py�0/path/to/non-installed/lib/python9.8/lib-dynloadryzhome = /path/to/non-installedz/path/to/non-installedr)z'/path/to/non-installed/lib/python98.zipz$/path/to/non-installed/lib/python9.8r�rANr}r-s    r�&test_venv_non_installed_zip_path_posixz7MockGetPathTests.test_venv_non_installed_zip_path_posix�s���
�$��)�
��
	���>�?�
���-�.�
���,�=�	?�
���F�G�
���K�L�
���,�,�/
�	��)�+�0�?�0�5�$%�!�

����X�&������6�*rc�4�tddd��}|jd�|jd�|jd�|jd�|jd	d
g�t	dddddddgd��
�}t||�}|j
||�y)zETest a venv --copies layout on *nix that lacks a distributed 'python'rZrYrvrwz/usr/bin/python9rxr^r_ryrzrr`rANrar-s    r�!test_venv_changed_name_copy_posixz2MockGetPathTests.test_venv_changed_name_copy_posix�s���
���)�
��
	���-�.�
���-�.�
���4�5�
���9�:�
���,��/
�	��)���.��#�$%�!�

����X�&������6�*rc	�,�tdd��}|jd�|jd�|jdd�|jd�|j	d�tdddddgd��	�}t
||�}|j||�y
)z4Test a 'standard' install layout via symlink on *nixrY�/linkfrom/python)r[rr]r^r_rr`rNr}r-s    r�test_symlink_normal_posixz*MockGetPathTests.test_symlink_normal_posix�s���
��$�
��	���-�.�
���,�-�
���,�.?�@�
���4�5�
���9�:��)�.���$%�!�

����X�&������6�*rc�x�tdd��}|jd�|jd�|jdd�|jd�|jddg�|jd�|j	d	�tddddd
ddgd��
�}t
||�}|j||�y)rer�rgrhrfrirjrkrlrmrnrrorrNr}r-s    r�test_symlink_buildpath_posixz-MockGetPathTests.test_symlink_buildpath_posix�s��� �%��
��	���-�.�
���1�2�
���,�.D�E�
���2�3�
���8�;W�:X�Y�
���3�4�
���4�5��)��$�.�(��$%�!�

����X�&������6�*rc	���tddd��}|jd�|jd�|jd�t	dddddgd	��
�}t||�}|j
||�y)z.Test an install with custom platlibdir on *nixrYr��lib64)r[r�
PLATLIBDIRr]z/usr/lib64/python9.8/os.py� /usr/lib64/python9.8/lib-dynloadr)z/usr/lib64/python98.zipz/usr/lib64/python9.8r�rNrar-s    r�test_custom_platlibdir_posixz-MockGetPathTests.test_custom_platlibdir_posixs���
��$��
��
	���,�-�
���6�7�
���;�<��)�.���$%�!�

����X�&������6�*rc��tdddddddd��}|jd�|jd�|jd�|jd	�t	dddddddgd
���}t||�}|j
||�y)
z� Test framework layout on macOS

        This layout is primarily detected using a compile-time option
        (WITH_NEXT_FRAMEWORK).
        �darwin�\/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Pythonr�1/Library/Frameworks/Python.framework/Versions/9.8�?/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8�8/Library/Frameworks/Python.framework/Versions/9.8/Python��os_namer�WITH_NEXT_FRAMEWORKr[�EXEC_PREFIXr@r�library�K/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload�E/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py�zB/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zipz?/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8r�rAN)rbr'r)r(r*r+r,r-s    r�test_framework_macosz%MockGetPathTests.test_framework_macoss��� ��p� !�F�K�$e�z�N�	
��	���y�z�
���\�]�
���f�g�
���a�b�
�X�F�K�]�K�P�$%�!�

����X�&������6�*rc�"�tddddddddddddd��
}|jd�|jd�|jd	�|jd
�tdddddddgd���}t	||�}|j||�y)
z� Test framework layout on macOS with alternate framework name

        ``--with-framework-name=DebugPython``

        This layout is primarily detected using a compile-time option
        (WITH_NEXT_FRAMEWORK).
        �f/Library/Frameworks/DebugPython.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/DebugPythonr�r�6/Library/Frameworks/DebugPython.framework/Versions/9.8�D/Library/Frameworks/DebugPython.framework/Versions/9.8/bin/python9.8�B/Library/Frameworks/DebugPython.framework/Versions/9.8/DebugPythonN)
rr�r�r[r�r@rr��
PYTHONPATHrT�ENV_PYTHONEXECUTABLE�executable_dir�
py_setpath�P/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8/lib-dynload�J/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8/os.py�zG/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python98.zipzD/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8r�rA)rbr'r)r*r+r,r-s    r�test_alt_framework_macosz)MockGetPathTests.test_alt_framework_macosDs��� �z�� !�K�P�$j�E�X���!%���
��	���D�	E�
���a�b�
���k�l�
���g�h��]�K�P�b�P�U�$%�!�

����X�&������6�*rc��d}tddddd|�d�dd��}|j|�|j|�d	��|j|�d
��|j|�d��|j|�d��|jd�|jd�|jd
�|jd�|j|�d�dg�t	|�d�ddddddgd���}t||�}|j
||�y)z<Test a venv layout on macOS using a framework build
        �/tmp/workdir/venvr�r�rr��/bin/pythonr�r��/bin�/lib�/lib/python9.8r�r�r��/pyvenv.cfgz<home = /Library/Frameworks/Python.framework/Versions/9.8/binr�rAN�rbr)r'r(r*r+r,�r�	venv_pathr.r/r0s     r�test_venv_framework_macosz*MockGetPathTests.test_venv_framework_macosss<��(�	�
��p� !�F�K�'0�k��$=�z�N�	
��	����#�
���I�;�d�+�,�
���I�;�d�+�,�
���I�;�n�5�6�
���i�[��4�5�
���y�z�
���\�]�
���f�g�
���b�c�
���Y�K�{�3�J�6
�	��#��K�0�F�K�]�K�P�$%�!�

����X�&������6�*rc��d}tddddd|�d�dd��}|j|�|j|�d	��|j|�d
��|j|�d��|j|�d��|jd�|jd�|jd
�|jd�|j|�d�dg�t	|�d�ddddddgd���}t||�}|j
||�y)zkTest a venv layout on macOS using a framework build

        ``--with-framework-name=DebugPython``
        r�r�r�rr�r�r�r�r�r�r�r�r�r�r�zAhome = /Library/Frameworks/DebugPython.framework/Versions/9.8/binr�rANr�r�s     r�test_venv_alt_framework_macosz.MockGetPathTests.test_venv_alt_framework_macos�sE��
(�	�
��z� !�K�P�'0�k��$=�E�X�	
��	����#�
���I�;�d�+�,�
���I�;�d�+�,�
���I�;�n�5�6�
���i�[��4�5�
���D�	E�
���a�b�
���k�l�
���g�h�
���Y�K�{�3�O�6
�	��#��K�0�K�P�b�P�U�$%�!�

����X�&������6�*rc�8�tddddd��}|jd�|jd�|jd�|jd�|jdd	g�t	ddddddd
gd���}t||�}|j
||�y
)z�Test a venv layout on macOS.

        This layout is discovered when 'executable' and 'real_executable' match,
        but $__PYVENV_LAUNCHER__ has been set to the original process.
        r�r]rYz/framework/Python9.8/python)r�rr[r@rr^r_z/framework/Python9.8/pyvenv.cfgrzrr`rANrar-s    r�test_venv_macosz MockGetPathTests.test_venv_macos�s��� ��#��$A�-�
��	���,�-�
���8�9�
���4�5�
���9�:�
���;��>
�	��4���-��#�$%�!�

����X�&������6�*rc	�2�tddddd��}|jd�|jd�|jdd�|jd�|j	d	�tddddd
gd���}t
||�}|j||�y
)z5Test a 'standard' install layout via symlink on macOSr�rYrZ�/linkfrom:/usr/binr�)r�r[rr\rr]r^r_rr`rNr}r-s    r�test_symlink_normal_macosz*MockGetPathTests.test_symlink_normal_macos�s���
����)�.�

��	���-�.�
���,�-�
���,�.?�@�
���4�5�
���9�:��)�.���$%�!�

����X�&������6�*rc�~�tddddd��}|jd�|jd�|jdd�|jd�|jd	d
g�|jd�|j	d�tddddd
ddgd���}t
||�}|j||�y)z�Test an in-build-tree layout via symlink on macOS.

        This layout is discovered from the presence of pybuilddir.txt, which
        contains the relative path from the executable's directory to the
        platstdlib path.
        r�rZr�rgr�)r�rr\r[rrfrirjzbuild/lib.macos-9.8rlrmrnr)rprqz!/home/cpython/build/lib.macos-9.8rrNr}r-s    r�test_symlink_buildpath_macosz-MockGetPathTests.test_symlink_buildpath_macoss��� ���)��.�

��	���-�.�
���1�2�
���,�.D�E�
���2�3�
���8�;P�:Q�R�
���3�4�
���4�5��)��$�.�(��$%�!�

����X�&������6�*r)�__name__�
__module__�__qualname__r
r1r>rDrLrPrRrUrWrcrsr{r~r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__�rs@rrrs�����+�2+�4#+�J/+�b+�6+�8+�<+�.+�2+�B+�>+�@+�B+�>+�4!+�F+�2'+�R-+�^)+�V++�Z#+�J+�<%+rrr[r6r�r��VPATHr��
PYDEBUGEXT�
VERSION_MAJOR�	�
VERSION_MINOR��PYWINVER�
EXE_SUFFIXr\rTr�r@rr�rr�r�rGr;�venv_prefix�home�
platlibdir�
pythonpath�program_namer!r"rBrCrr �
stdlib_dir�platstdlib_dirr$r#�pythonpath_env�argv�	orig_argv�isolatedrIr�use_sitec���eZdZddd��fd�
Zdd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Z�xZS)r&N�rrHc�.��|jt�tj�|d<d|d<d|d<d|d<d|d	<t	�|�|i|��|r	|g|dd
<|r|dj|�i|_i|_t�|_	g|_
y)NrH�ntr��DLLsr�z9.8-XYr�z..\..r�r�)�update�DEFAULT_NAMESPACE�DEFAULT_CONFIG�copyr	r
�_files�_links�set�_dirs�	_warnings�rrrHr
rrs     �rr
zMockNTNamespace.__init__ks�������%�&�'�,�,�.��X����Y��#��\��#��Z�� ��W�
�
���!�"�r�"��+0�'�D��N�;�'����N�!�!�&�)��������U��
���rc��t|xsd�|j|j�<|j|j	d�d�y)N��\r)�listr��casefoldr)�
rpartition�r�path�liness   rr(zMockNTNamespace.add_known_file|s;��'+�E�K�R�'8����D�M�M�O�$����4�?�?�4�0��3�4rc�&�|j|�yr)r(�rr�s  rr'zMockNTNamespace.add_known_xfile�s�����D�!rc�>�||j|j�<yr)r�r��rr��targets   rrOzMockNTNamespace.add_known_link�s��'-����D�M�M�O�$rc��|jd�j�}|r3|jj|�|j	d�d}|r�2yy)Nr�r)�rstripr�r��addr��rr��ps   rr)zMockNTNamespace.add_known_dir�sD���K�K���&�&�(����J�J�N�N�1�����T�"�1�%�A�rc�N�	t||�S#t$r
t|�d�wxYwr��getattr�AttributeError�KeyError�r�keys  r�__missing__zMockNTNamespace.__missing__��/��	*��4��%�%���	*��3�-�T�)�	*����$c�L�|j|�r|S|jd|�S)NzC:\Absolute��isabs�joinpathr�s  r�abspathzMockNTNamespace.abspath�s$���:�:�d���K��}�}�^�T�2�2rc�*�|jd�dS)Nr���r�r�s  r�basenamezMockNTNamespace.basename�s�����t�$�Q�'�'rc�f�|jd�jd�d}|dddk(r|dzS|S)Nr�rr�:�r�r�)rr��names   r�dirnamezMockNTNamespace.dirname�s<���{�{�4� �+�+�D�1�!�4�����8�s�?��$�;���rc�\�|j�j|j��Sr)r��endswith�rr��suffixs   r�	hassuffixzMockNTNamespace.hassuffix�s ���}�}��'�'����(9�:�:rc��|dddk(S)Nr�z:\r�r�s  rrzMockNTNamespace.isabs�s���A�a�y�E�!�!rc�`�tr
td|d�|j�|jvS�N�Check ifzis a dir)r�printr�r�r�s  r�isdirzMockNTNamespace.isdir�s&����*�d�J�/��}�}��$�*�*�,�,rc�`�tr
td|d�|j�|jvS�Nrz	is a file)rrr�r�r�s  r�isfilezMockNTNamespace.isfile�s&����*�d�K�0��}�}��$�+�+�-�-rc��tr
td|d�|j�}||jvxr%|j	d�ddj�k(S�Nrzis a module�.r	�py�rrr�r�r�r�s  r�ismodulezMockNTNamespace.ismodule�sI����*�d�M�2��}�}����t�{�{�"�Q�t���s�';�A�'>�$�-�-�/�'Q�Qrc��tr
td|d�|j�}||jvxr%|j	d�ddj�k(S)Nrzis a executabler"r	�exer$r�s  r�isxfilezMockNTNamespace.isxfile�sK����*�d�$5�6��}�}����t�{�{�"�R�t���s�';�A�'>�%�.�.�BR�'R�Rrc�L�tjtj|��Sr)�ntpath�normpath�joinr�s  rrzMockNTNamespace.joinpath�s�����v�{�{�D�1�2�2rc�p�	|j|j�S#t$r
t|�d�wxYwr)r�r�r��FileNotFoundErrorr�s  r�	readlineszMockNTNamespace.readlines�s8��	4��;�;�t�}�}��/�/���	4�#�D�)�t�3�	4�s��5c�:�trtd|�	|j|j�}|�t�}n|j�|vrt
d��|j|j��|j||�S#t$r|cYSwxYw�NzRead link fromz
circular link)	rrr�r�r�r��OSErrorr��realpath�rr��_trail�links    rr3zMockNTNamespace.realpath�s�����"�D�)�	��;�;�t�}�}��/�D��>��U�F�
�]�]�_��
&��/�*�*��
�
�4�=�=�?�#��}�}�T�6�*�*���	��K�	�s�B�B�Bc�^�|jj|�trt|�yyr�r��appendrr�r�messages  r�warnzMockNTNamespace.warn��#�������g�&���'�N�rr�r�r�r�r
r(r'rOr)rrrrrrrrr%r(rr/r3r<r�r�s@rr&r&jsi���!%�d��"5�"�.�&�*�3�
(��;�"�-�
.�
R�S�3�4�+�rr&c�D�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)rJ�HKLM�HKCUc��|j�D��cic]\}}|j�|��c}}|_i|_ycc}}wr)�itemsr��keys�open)rrD�k�vs    rr
zMockWinreg.__init__�s8��15����>����A�Q�Z�Z�\�1�_��>��	���	��?s�Ac��y)Nz<MockWinreg>r��rs r�__repr__zMockWinreg.__repr__�s��rc�,�t|t|��Sr)�
isinstance�type)r�others  r�__eq__zMockWinreg.__eq__�s���%��d��,�,rc�,�t|j�Sr)r�rErIs r�	open_keyszMockWinreg.open_keys�s���D�I�I��rc���trtd|�d|�d��|�d|��j�}||jvr.|jj|d�dz|j|<|St
��)Nz
OpenKeyEx(�, �)r�rr)rrr�rDrE�getr.)rrK�subkeyr�s    r�	OpenKeyExzMockWinreg.OpenKeyEx�sp����J�t�f�B�v�h�a�0�1���b���!�*�*�,���$�)�)��!�Y�Y�]�]�3��2�Q�6�D�I�I�c�N��J��!�!rc���trtd|�d��|j�}||jvrt	d��|j|xxdzcc<|j|s|j|=yy)Nz	CloseKey(rT�key is not openr)rrr�rE�RuntimeError)rrKs  r�CloseKeyzMockWinreg.CloseKey�sf����I�d�V�1�%�&��}�}����t�y�y� ��0�1�1��	�	�$��1����y�y����	�	�$��rc��trtd|�d|�d��|j�}||jvrt	d��|�d�}t|j�D�cgc]"}|j|�s�|t|�d��$}}|D�cgc]	}d|vs�|��c}|ddt|�D]\}}||k(s�|j|�cStd��cc}wcc}w)NzEnumKey(rSrTrYr�zend of enumeration)rrr�rErZ�sortedrD�
startswith�len�	enumerate�removeprefixr2)rrK�ir!rF�subkeys�j�ns        r�EnumKeyzMockWinreg.EnumKey�s�����H�T�F�"�Q�C�q�)�*��}�}����t�y�y� ��0�1�1��6����,2�4�9�9�,=�V�,=�q����f�AU�1�S��[�\�?�,=��V�!(�:��A�D��M�a��:���
��g�&�D�A�q��A�v��~�~�f�-�-�'��*�+�+��W��:s�C�5C�	C�Cc��trtd|�d|�d��|j�}||jvrt	d��|r|j�}|�d|��}	|j
|S#t$rt��wxYw)NzQueryValue(rSrTrYr�)rrr�rErZrDr�r2)rrKrVs   r�
QueryValuezMockWinreg.QueryValues�����K��v�R��x�q�1�2��}�}����t�y�y� ��0�1�1���_�_�&�F��V�2�f�X�&�D�	��9�9�T�?�"���	��)�O�	�s�A+�+A?N)
r�r�r��HKEY_LOCAL_MACHINE�HKEY_CURRENT_USERr
rJrOrQrWr[rfrhr�rrrJrJ�s6��������-��"� �,�rrJc���eZdZddd��fd�
Zdd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Z�xZS)rbNr�c�B��|jt�tj�|d<d|d<d|d<d|d<t	�|�|i|��|r	|g|dd<|r|dj|�i|_t�|_i|_	t�|_
g|_y)	NrH�posixr��libr�rr�r�)r�r�r�r�r	r
r�r��_xfilesr�r�r�r�s     �rr
zMockPosixNamespace.__init__s�������%�&�'�,�,�.��X��!��Y��"��\��&'��
"�#�
���!�"�r�"��+0�'�D��N�;�'����N�!�!�&�)�����u�������U��
���rc��t|xsd�|j|<|j|jd�d�y)Nr��/r)r�r�r)r�r�s   rr(z!MockPosixNamespace.add_known_file,s5�� ���"�-����D�����4�?�?�3�/��2�3rc�\�|j|�|jj|�yr)r(ror�r�s  rr'z"MockPosixNamespace.add_known_xfile0s"�����D�!�������rc�"�||j|<yr)r�r�s   rrOz!MockPosixNamespace.add_known_link4s��"����D�rc��|jd�}|r3|jj|�|jd�d}|r�2yy�Nrqr)r�r�r�r�r�s   rr)z MockPosixNamespace.add_known_dir7s;���K�K������J�J�N�N�1�����S�!�!�$�A�rc�N�	t||�S#t$r
t|�d�wxYwrr�r�s  rrzMockPosixNamespace.__missing__=rrc�L�|j|�r|S|jd|�S)Nz	/Absoluterr�s  rrzMockPosixNamespace.abspathCs$���:�:�d���K��}�}�[�$�/�/rc�*�|jd�dS)Nrqr	r
r�s  rrzMockPosixNamespace.basenameHs�����s�#�A�&�&rc�H�|jd�jd�dSrurr�s  rrzMockPosixNamespace.dirnameKs!���{�{�3��*�*�3�/��2�2rc�$�|j|�Sr)rrs   rrzMockPosixNamespace.hassuffixNs���}�}�V�$�$rc��|dddk(S)Nrrrqr�r�s  rrzMockPosixNamespace.isabsQs���A�a�y�C��rc�D�tr
td|d�||jvSr)rrr�r�s  rrzMockPosixNamespace.isdirTs ����*�d�J�/��t�z�z�!�!rc�D�tr
td|d�||jvSr)rrr�r�s  rrzMockPosixNamespace.isfileYs ����*�d�K�0��t�{�{�"�"rc�v�tr
td|d�||jvxr|jd�ddk(Sr!)rrr�r�r�s  rr%zMockPosixNamespace.ismodule^s8����*�d�M�2��t�{�{�"�F�t���s�';�A�'>�$�'F�Frc�D�tr
td|d�||jvS)Nrzis an xfile)rrror�s  rr(zMockPosixNamespace.isxfilecs ����*�d�M�2��t�|�|�#�#rc�L�tjtj|��Sr)�	posixpathr+r,r�s  rrzMockPosixNamespace.joinpathhs���!�!�)�.�.�$�"7�8�8rc�T�	|j|S#t$r
t|�d�wxYwr)r�r�r.r�s  rr/zMockPosixNamespace.readlinesks2��	4��;�;�t�$�$���	4�#�D�)�t�3�	4�s��'c���trtd|�	|j|}|�t	�}n||vrtd��|j
|�|j||�S#t$r|cYSwxYwr1)rrr�r�r�r2r�r3r4s    rr3zMockPosixNamespace.realpathqsv����"�D�)�	��;�;�t�$�D��>��U�F�
�V�^��/�*�*��
�
�4���}�}�T�6�*�*���	��K�	�s�A"�"A0�/A0c�^�|jj|�trt|�yyrr8r:s  rr<zMockPosixNamespace.warnr=rrr>r�s@rrbrbsh���!%�d��"4��#�%�*�0�
'�3�%� �"�
#�
G�
$�
9�4�+�rrbc
���g}t|�D]P}|dddk(r�|dk(rt||||d���&||vs�+||||k7s�7|j|||||f��R|sytd�|D��}dt	|�dz|zz}t
rg|D]a\}}}|r.t
dj||j|�|||���7t
d	j||j|�|���cyy)
Nr	�__rH�r!c3�:K�|]\}}}t|����y�wr�r_)�.0rF�_s   r�	<genexpr>zdiff_dict.<locals>.<genexpr>�s����+�d�7�1�a���A��d�s�� rz{}.{} -{!r}
{} +{!r}z{}.{} +{!r})	r]�	diff_dictr9�maxr_rr�format�ljust)	�before�afterr!�diffrF�max_k�indent�br
s	         rr�r��s��
�D�
�F�^���R�a�5�D�=����=��f�Q�i��q��(�;����:�%��(�f�Q�i�/��K�K��F�1�I�u�Q�x�0�1�����+�d�+�+�E�
�C��K�!�O�e�+�
,�F���G�A�q�!���-�4�4�V�Q�W�W�U�^�Q�PV�XY�Z�[��m�*�*�6�1�7�7�5�>�1�E�F�	�rc
��tr|sytd�|D��}t|j�d���D]�\}}|dddk(r�|dk(rt	||||d���)	|||k7r0tdj
||j|�|||���b	td	j
||j|�|����y#t$rY�9wxYw)
Nc3�2K�|]}t|����y�wrr�)r�rFs  rr�zdump_dict.<locals>.<genexpr>�s����&��1��A���s�c��|dS)Nrr�)rbs r�<lambda>zdump_dict.<locals>.<lambda>�s��A�a�Dr)r�r	r�rHr�z{}.{} {!r} (was {!r})z
{}.{} {!r})	rr�r]rC�	dump_dictrr�r�r�)r�r�r!r�rFrGs      rr�r��s����%���&��&�&�E��u�{�{�}�.�9���1��R�a�5�D�=����=��f�Q�i��q��(�;��	��F�1�I�~��-�4�4�V�Q�W�W�U�^�Q�PV�WX�PY�Z�[���
	�l�!�!�&�!�'�'�%�.�!�<�=�:���	��	�s�"7C	�		C�Cc�@�tj|�}d}	tt|�d}|r
t	||�n
t||�	|D�cic](}||dj
||j
|d����*c}S#|r
t	||�wt||�wxYwcc}w)NTFrH.)r��deepcopy�exec�SOURCEr�r�rU)r.rDr��failedrFs     rr+r+�s���
�]�]�2�
�F�
�F�"��V�R������f�b�!��f�b�!����A�	
�2�h�<���A�r�v�v�a��~�.�.�����	��f�b�!��f�b�!��s�A;�-B�;Br�)�global)r�r*�pathlibr��unittest�test.supportr�Path�__file__�absolute�parent�
read_bytesr�r.�_testinternalcapir�TestCaserr*r�r�r&rJrbr�r�r+r�rr�<module>r�sv���
���� �&��g�l�l�8�$�-�-�/�6�6�=�=�D�D�G[�[�
g�
g�
i�F�a+�x�(�(�a+�L��
������
�	�
���
����������������� 
�!�"�#�$�%�&�'�(
�)�*�+�,�-�.�/��4��	
�������	�
���
������������������� 
�!�"�#�&�'�(�)�*�+��0l�d�l�^>�>�Bh��h�VG�,>�&��E%�&�8�
#�
%�F�&�s�AD6�6E�
E

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists