o
    Ni                     @   sb   d dl mZ d dl mZ d dlZd dlZd dlmZ d dlmZ d dlmZ	 G dd dej
ZdS )	    )absolute_import)print_functionN)files)base)fixturesc                       sT   e Zd Z fddZdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
  ZS )FilesConfigTestc                    sL  t t|   tdddg}| | tj|j	d}tj|j	ddd}tj|j	d}tj|j	d	d
}tj|d}tj|j	dd}t
| t
| t
| t
| t
| ttj|dd}|d W d    n1 szw   Y  ttj|dd}|d W d    n1 sw   Y  ttj|dd}	|	d W d    n1 sw   Y  ttj|dd}|d W d    n1 sw   Y  ttj|dd}
|
d W d    n1 sw   Y  ttj|dd}|d W d    n	1 sw   Y  | t|j	 d S )Nfake_package)zfake_module.py    )zother_fake_module.pyr	   etcansiblezkolla-ansibletestzdir with spacezmulti spacezmore spacessub
subpackagefoowzFoo DatabarzBar DatabazzBaz Dataz__init__.pyz# emptyzfile with spc)superr   setUpr   PythonPackage
useFixtureospathjoinr   makedirsopenwritepbr_fixturesChdir)selfpkg_fixturepkg_etcpkg_ansibledir_spcsdir_subdir_spcpkg_subr   foo_filebaz_filespc_filefile_	__class__ H/home/ubuntu/.local/lib/python3.10/site-packages/pbr/tests/test_files.pyr      sX   






zFilesConfigTest.setUpc                 C   s0   di i}t |d  | d|d d  d S )Nr   r   r   packagesr   FilesConfigrunassertInr   configr,   r,   r-   test_implicit_auto_packageI   s   z*FilesConfigTest.test_implicit_auto_packagec                 C   s4   dddii}t |d  | d|d d  d S )Nr   r.   r   r   r/   r3   r,   r,   r-   test_auto_packageN   s   z!FilesConfigTest.test_auto_packagec                 C   4   dddii}t |d  | d|d d  d S )Nr   
data_filesz
  etc/pbr = etc/*r   z9
'etc/pbr/' = 
 'etc/foo'
'etc/pbr/sub' = 
 'etc/sub/bar'r/   r3   r,   r,   r-   test_data_files_globbingS   s   
z(FilesConfigTest.test_data_files_globbingc                 C   r7   )Nr   r8   z'
  'i like spaces' = 'dir with space'/*r   z4
'i like spaces/' = 
 'dir with space/file with spc'r/   r3   r,   r,   r-   test_data_files_with_spaces[   s   
z+FilesConfigTest.test_data_files_with_spacesc                 C   <   d}d}dd|ii}t |d  | ||d d  d S )Nz5
 'one space/two space' = 'multi space/more spaces'/*C
'one space/two space/' = 
 'multi space/more spaces/file with spc'r   r8   r   r/   r   r8   expectedr4   r,   r,   r-   *test_data_files_with_spaces_subdirectoriese   s   z:FilesConfigTest.test_data_files_with_spaces_subdirectoriesc                 C   r;   )Nz8
'one space'/'two space' = 'multi space'/'more spaces'/*r<   r   r8   r   r/   r=   r,   r,   r-   -test_data_files_with_spaces_quoted_componentsp   s   z=FilesConfigTest.test_data_files_with_spaces_quoted_componentsc                 C   r7   )Nr   r8   z
  share/ansible = ansible/*r   z}
'share/ansible/' = 
'share/ansible/kolla-ansible' = 
'share/ansible/kolla-ansible/test' = 
 'ansible/kolla-ansible/test/baz'r/   r3   r,   r,   r-   8test_data_files_globbing_source_prefix_in_directory_name}   s   
zHFilesConfigTest.test_data_files_globbing_source_prefix_in_directory_name)__name__
__module____qualname__r   r5   r6   r9   r:   r?   r@   rA   __classcell__r,   r,   r*   r-   r      s    +
r   )
__future__r   r   r   r   	pbr.hooksr   	pbr.testsr   r   BaseTestCaser   r,   r,   r,   r-   <module>   s   