
    ce                     |    d dl mZ d dlmZ d dlmZ  G d dej                        Z G d dej                        Zy)	    )mock)base)sphinxconfiggenc                      e Zd Z ej                  d       ej                  d       ej                  d      d                      Z ej                  d       ej                  d       ej                  d      d                      Zy)SingleSampleGenerationTestos.path.isdiros.path.isfileoslo_config.generator.mainc                     ddg|_         d|_        t        j                  dd      }t        j                  d|      }t	        j
                  |       |j                  g d	       y )
NFTnova-gen.confnovaconfig_generator_config_filesample_config_basename	/opt/novasrcdirconfig)--config-file/opt/nova/nova-gen.conf--output-filez/opt/nova/nova.conf.sampleargsside_effectreturn_valuer   Mockr   generate_sampleassert_called_once_withselfmainisfileisdirr   apps         H/usr/lib/python3/dist-packages/oslo_config/tests/test_sphinxconfiggen.py'test_sample_gen_with_single_config_filezBSingleSampleGenerationTest.test_sample_gen_with_single_config_file   s_     $T]!28:ii{6:'',$$ +-$ 	.    c                     ddg|_         d|_        t        j                  dd       }t        j                  d|      }t	        j
                  |       |j                  g d       y )	NFTr   r   r   r   )r   r   r   z/opt/nova/sample.configr   r   r    s         r&   /test_sample_gen_with_single_config_file_no_basezJSingleSampleGenerationTest.test_sample_gen_with_single_config_file_no_base(   sa    
 $T]!268ii{6:'',$$ +F$ 	Gr(   N)__name__
__module____qualname__r   patchr'   r*    r(   r&   r   r      s    TZZ TZZ !TZZ,-. . " !. TZZ TZZ !TZZ,-G . " !Gr(   r   c                      e Zd Z ej                  d       ej                  d       ej                  d      d                      Z ej                  d       ej                  d       ej                  d      d                      Z ej                  d       ej                  d       ej                  d      d                      Zy)MultipleSampleGenerationTestr   r	   r
   c                 8   g d|_         d|_        ddg}t        j                  |      }t        j                  d|      }t	        j
                  |       | j                  |j                  d       |j                  g d	
       |j                  g d
       y )NFTFTTglance-api-gen.confz
glance-api)glance-reg-gen.confz
glance-regr   /opt/glancer      r   /opt/glance/glance-api-gen.confr   z"/opt/glance/glance-api.conf.sampler   )r   /opt/glance/glance-reg-gen.confr   z"/opt/glance/glance-reg.conf.sample	r   r   r   r   r   r   assertEqual
call_countassert_any_callr!   r"   r#   r$   multiple_configsr   r%   s          r&   test_multi_sample_genz2MultipleSampleGenerationTest.test_multi_sample_gen=   s     8!AAC8HIii}V<'',!, #I 	J 	 #I 	Jr(   c                 8   g d|_         d|_        ddg}t        j                  |      }t        j                  d|      }t	        j
                  |       | j                  |j                  d       |j                  g d	
       |j                  g d
       y )Nr3   Tr4   r6   Nr7   r8   r   r9   r:   r   r   r<   r   z&/opt/glance/glance-reg-gen.conf.sampler=   rA   s          r&   +test_multi_sample_gen_with_without_one_basezHMultipleSampleGenerationTest.test_multi_sample_gen_with_without_one_baseT   s     8!A9;8HIii}V<'',!, #I 	J 	 #M 	Nr(   c                 8   g d|_         d|_        ddg}t        j                  |      }t        j                  d|      }t	        j
                  |       | j                  |j                  d       |j                  g d	
       |j                  g d
       y )Nr3   T)r5   NrE   r7   r8   r   r9   )r   r;   r   z&/opt/glance/glance-api-gen.conf.sampler   rF   r=   rA   s          r&   +test_multi_sample_gen_with_without_any_basezHMultipleSampleGenerationTest.test_multi_sample_gen_with_without_any_basek   s     8!99;8HIii}V<'',!, #M 	N 	 #M 	Nr(   N)r+   r,   r-   r   r.   rC   rG   rI   r/   r(   r&   r1   r1   ;   s    TZZ TZZ !TZZ,-J . " !J( TZZ TZZ !TZZ,-N . " !N( TZZ TZZ !TZZ,-N . " !Nr(   r1   N)	unittestr   oslotestr   oslo_configr   BaseTestCaser   r1   r/   r(   r&   <module>rN      s;      '$G!2!2 $GNEN4#4#4 ENr(   