| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/test/test_importlib/source/__pycache__/ |
Upload File : |
�
���g| � �D � d Z ddlZddlmZ ej d� Z ej d� ZddlZddlm Z ddl
Z
ddlZej G d� dej � � Z G d � d
e� Z ej eee�� \ ZZedk( r e
j( � yy)
z Test case-sensitivity (PEP 235).� N)�util� importlibzimportlib.machinery)� os_helperc � � e Zd ZdZdZeej � k7 sJ �d� Zd� Z ej e
j j d� d� � Z
ej e
j j d� d� � Zy) �CaseSensitivityTestz�PEP 235 dictates that on case-preserving, case-insensitive file systems
that imports are case-sensitive unless the PYTHONCASEOK environment
variable is set.�MoDuLec �� � | j j || j j | j j f| j j | j j
f� S �N)� machinery�
FileFinder�SourceFileLoader�SOURCE_SUFFIXES�SourcelessFileLoader�BYTECODE_SUFFIXES)�self�paths �EC:\Python312\\Lib\test\test_importlib\source\test_case_sensitivity.py�finderzCaseSensitivityTest.finder s] � ��~�~�(�(��'+�~�~�'F�'F�,0�N�N�,J�,J�'L�)-���)L�)L�,0�N�N�,L�,L�)N�O� O� c � � dj | j � }dj | j j � � }t j ||� }|5 }t
j j |d d� }t
j j |d d� }| j |� }| j |� }| j |� | j |� fcddd� S # 1 sw Y yxY w)z=Look for a module with matching and non-matching sensitivity.z
sensitive.{0}zinsensitive.{0}z.root� sensitive�insensitiveN)
�format�name�lowerr �create_modules�osr �joinr �find) r �
sensitive_pkg�insensitive_pkg�context�mapping�sensitive_path�insensitive_path�sensitive_finder�insensitive_finders r �sensitivity_testz$CaseSensitivityTest.sensitivity_test s� � �'�.�.�t�y�y�9�
�+�2�2�4�9�9�?�?�3D�E���%�%�o�}�E��
���W�W�\�\�'�'�*:�K�H�N�!�w�w�|�|�G�G�,<�m�L��#�{�{�>�:��!%���-=�!>���9�9�-�.�� � �:L�0M�M� �W�W�s
�B
C1�1C:zignore_environment flag was setc �p � t j � 5 }|j d� | j d�� | j � \ }}| j |� | j
| j |j | j � � | j |� d d d � y # 1 sw Y y xY w)N�PYTHONCASEOKF��should_exist)
r �EnvironmentVarGuard�unset�caseok_env_changedr( �assertIsNotNone�assertInr �get_filename�assertIsNone�r �envr r s r �test_sensitivez"CaseSensitivityTest.test_sensitive, s� � �
�
*�
*�
,���I�I�n�%��#�#��#�7�%)�%:�%:�%<�"�I�{�� � ��+��M�M�$�)�)�Y�%;�%;�D�I�I�%F�G����k�*�
-�
,�
,�s �BB,�,B5c �� � t j � 5 }|j dd� | j d�� | j � \ }}| j |� | j
| j |j | j � � | j |� | j
| j |j | j � � d d d � y # 1 sw Y y xY w)Nr* �1Tr+ ) r r- �setr/ r( r0 r1 r r2 r4 s r �test_insensitivez$CaseSensitivityTest.test_insensitive6 s� � �
�
*�
*�
,���G�G�N�C�(��#�#��#�6�%)�%:�%:�%<�"�I�{�� � ��+��M�M�$�)�)�Y�%;�%;�D�I�I�%F�G�� � ��-��M�M�$�)�)�[�%=�%=�d�i�i�%H�I� -�
,�
,�s �CC"�"C+N)�__name__�
__module__�__qualname__�__doc__r r r r( �unittest�skipIf�sys�flags�ignore_environmentr6 r: � r r r r s� � �� �D��4�:�:�<����O�
N� �X�_�_�S�Y�Y�1�1�3T�U�+� V�+� �X�_�_�S�Y�Y�1�1�3T�U�J� V�Jr r c � � e Zd Zd� Zy)�CaseSensitivityTestPEP451c �X � |j | j � }|�|j S |S r
)� find_specr �loader)r r �founds r r zCaseSensitivityTestPEP451.findC s* � �� � ����+��$�0�u�|�|�;�e�;r N)r; r<