HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pbr/tests/__pycache__/test_files.cpython-38.pyc
U

jP�^Y�@sJddlmZddlZddlZddlmZddlmZGdd�dej�Z	dS)�)�print_functionN��files)�basecsTeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�FilesConfigTestc	s�tt|���t�dddg�}|�|�tj�|j	d�}tj�|j	ddd�}tj�|j	d�}tj�|j	d	d
�}tj�|d�}tj�|j	dd�}t�
|�t�
|�t�
|�t�
|�t�
|�ttj�|d
�d��}|�d�W5QRXttj�|d�d��}|�d�W5QRXttj�|d�d��}	|	�d�W5QRXttj�|d�d��}|�d�W5QRXttj�|d�d��}
|
�d�W5QRXttj�|d�d��}|�d�W5QRX|�t	�
|j	��dS)N�fake_package)zfake_module.py�)zother_fake_module.pyr�etcZansiblez
kolla-ansibleZtestzdir with spacezmulti spacezmore spaces�sub�
subpackageZfoo�wzFoo DataZbarzBar DataZbazzBaz Dataz__init__.pyz# emptyz
file with spc)�superr�setUp�fixturesZ
PythonPackageZ
useFixture�os�path�joinr�makedirs�open�writeZDiveDir)�selfZpkg_fixtureZpkg_etcZpkg_ansibleZdir_spcsZdir_subdir_spcZpkg_subrZfoo_fileZbaz_fileZspc_fileZfile_��	__class__��6/usr/lib/python3/dist-packages/pbr/tests/test_files.pyrsR��
���




zFilesConfigTest.setUpcCs4tt�d�}t�|d���|�d|dd�dS)Nrrrr�packages��dictrZFilesConfig�runZassertIn�r�configrrr�test_implicit_auto_packageBs
�z*FilesConfigTest.test_implicit_auto_packagecCs8ttdd�d�}t�|d���|�d|dd�dS)Nr)rrrrrrrrrr�test_auto_packageJs��z!FilesConfigTest.test_auto_packagecCs8ttdd�d�}t�|d���|�d|dd�dS)Nz
  etc/pbr = etc/*��
data_filesrrz9
'etc/pbr/' = 
 'etc/foo'
'etc/pbr/sub' = 
 'etc/sub/bar'rr$rrrrr�test_data_files_globbingSs��
�z(FilesConfigTest.test_data_files_globbingcCs8ttdd�d�}t�|d���|�d|dd�dS)Nz'
  'i like spaces' = 'dir with space'/*r#rrz4
'i like spaces/' = 
 'dir with space/file with spc'rr$rrrrr�test_data_files_with_spaces^s��
�z+FilesConfigTest.test_data_files_with_spacescCs@d}d}tt|d�d�}t�|d���|�||dd�dS)Nz5
 'one space/two space' = 'multi space/more spaces'/*�C
'one space/two space/' = 
 'multi space/more spaces/file with spc'r#rrrr$r�rr$Zexpectedr rrr�*test_data_files_with_spaces_subdirectoriesis���z:FilesConfigTest.test_data_files_with_spaces_subdirectoriescCs@d}d}tt|d�d�}t�|d���|�||dd�dS)Nz8
'one space'/'two space' = 'multi space'/'more spaces'/*r'r#rrrr$rr(rrr�-test_data_files_with_spaces_quoted_componentsws���z=FilesConfigTest.test_data_files_with_spaces_quoted_componentscCs8ttdd�d�}t�|d���|�d|dd�dS)Nz
  share/ansible = ansible/*r#rrz}
'share/ansible/' = 
'share/ansible/kolla-ansible' = 
'share/ansible/kolla-ansible/test' = 
 'ansible/kolla-ansible/test/baz'rr$rrrrr�8test_data_files_globbing_source_prefix_in_directory_name�s��
�zHFilesConfigTest.test_data_files_globbing_source_prefix_in_directory_name)�__name__�
__module__�__qualname__rr!r"r%r&r)r*r+�
__classcell__rrrrrs&	r)
Z
__future__rrrZ	pbr.hooksrZ	pbr.testsrZBaseTestCaserrrrr�<module>s