
    ce                     J   d dl Z d dlZd dlZd dlmZ d dl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 d dl
mZ d dlZe	j"                  Zd Zd	 Z G d
 dej*                        Z G d dej*                        Z G d dej*                        Zdddgdddg dZ G d dej*                        Z G d dej*                        Z G d dej*                        Z G d dej*                        Z G d dej*                        Z G d d ej*                        Z G d! d"ej*                        Z  G d# d$ej*                        Z! G d% d&ej*                        Z" G d' d(ej*                        Z# G d) d*ej*                        Z$ejK                          ejK                          y)+    N)mock)base)cfg)fixture)	generator)typesc                     | S )z0Something that acts like a type, but isn't known )as    B/usr/lib/python3/dist-packages/oslo_config/tests/test_generator.pycustom_typer   $   s    H    c                     t        j                         }|j                  t        j                         |j                         D ]  \  }}|j                  ||        t        j                  ||       S Noutput_file)r   
ConfigOptsregister_optsr   _generator_optsitemsset_override_OptFormatter)r   kwargsconfkvs        r   build_formatterr   )   s^    >>Dy001  1!Q ""4[AAr   c                   @    e Zd Z ej                  dd       ej                  dd       ej                  ddd	
      dZi d ej                  dd      d ej                  dd      d ej                  dd      d ej                  d      d ej                  dd      d ej                  dd      d ej                  dddd      d ej                  ddd      d ej                  dd d!"      d# ej                  d$d%d d&d'(      d) ej                  d*d d+,      d- ej                  dddd.      d/ ej                  dd0 ej                  dd1      g2      d3 ej                  d4d5d6 e
j                  d78      9      d: ej                  d:d;d<=      d> ej                  d:d?d<=      d@ ej                  d:dAdB=      i dC ej                  d:dDdE=      dF ej                  dFd%dG=      dH ej                  dHdIdJdKdLM      dN ej                  dNdIdOdKdLM      dP ej                  dPdQdOdLR      dS ej                  dSdTdU=      dV ej                  dVg dWdX=      dY ej                  dYg dWdXd Z      d[ ej                  d[d\dX=      d] ej                  d]g d^dX=      d_ ej                  d_d`dadbdc=      dd ej                   dddedf=      dg ej"                  dgdhdi=      dj ej$                  djdkdl=      dm ej&                  dmdndo=      dp ej(                  dpg dWdq=      dr ej(                  drdq       ej(                  dsg dq=       ej(                  dpg dWdtdugdqv       ej                  dwdxdyz       ej                  d{d|e}       ej                  d~d|e}       ej                  dd|e}       ej                  dde}       ej                  d e
j2                  d8      dd      dZg d eg d      fd edded   gfgfgd      fd edded   gfgfdded   gfgfgd      fd eded   ed   gfgfgd      fd eded   g fgfgd      fd eded   ed   gfed   ed   gfgfgd      fd eded   ed   gfgfded   ed   gfgfgd      fd edded   gfgfgd      fd edded   gfgfgdd      fd edded   gfgfgd      fd edded   gfgfgdd      fd edded   gfgfgdOd      fd edded   gfgfgdd      fd edded   gfgfgd      fd eded   ed   gfgfgd      fd eded   ed   gfgfgd      fd eded   ed#   gfgfgd      fd- eded   ed-   gfgfgd      fd3 edded3   gfgfgd      fd: edded:   gfgfgd      fd@ edded@   gfgfgd      fdC eddedC   gfgfgd      fdF eddedF   gfgfgd      fdH eddedH   gfgfgd      fdN eddedN   gfgfgd      fdP eddedP   gfgfgd      fdS eddedS   gfgfgd      fdV eddedV   gfgfgd      fdY eddedY   gfgfgd      fd[ edded[   gfgfgd      fd] edded]   gfgfgd      fd_ edded_   gfgfgd      fdd eddedd   gfgfgd      fdg eddedg   gfgfgd      fdj eddedj   gfgfgd      fdp eddedp   gfgfgd      fdr eddedr   gfgfgd¬      fds eddeds   gfgfgdì      fd> edded>   gfgfgdĬ      fd{ edded{   gfgfgdŬ      fd~ edded~   gfgfgdƬ      fd edded   gfgfgdǬ      fd edded   gfgfgdɬ      fd edded   gfgfgdˬ      fd edded   gfgfgd̬      fdw eddedw   gfgfgdͬ      fd edded:   gfed   edH   gfgfddedF   gfgfgdϬ      fd eded   edH   gfded:   gfgfded   edF   gfgfgdѬ      fd/ edded/   gfgfgdҬ      fZd ed dԫ      fd edd%׫      fgZed؄        Z fdلZ dڄ Z!dۄ Z"e#jH                  jK                  e&dܫ      e#jH                  jK                  e&dݫ      dބ               Z' xZ(S )GeneratorTestCasegroup1a  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in.)namehelpgroup2zGroup 2)r!   titlefooz	Foo Titlezfoo help)r!   r$   r"   )r    r#   r%   
foo optionr"   bar
bar optionfoo-barfoobarno_help	long_helpa  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.long_help_prezThis is a very long help text which is preformatted with line breaks. It should break when it is too long but also keep the specified line breaks. This makes it possible to create lists with items:

* item 1
* item 2

and should increase the readability.choices_optr   )N r   bcza string with choices)defaultchoicesr"   'deprecated_opt_without_deprecated_group
deprecated)deprecated_namer"   deprecated_for_removal_optTzdeprecated for removal)deprecated_for_removalr"   deprecated_reason_optturn_off_stoveFzTThis was supposed to work but it really, really did not. Always buy house insurance.zDEPRECATED: Turn off stove)r3   r9   deprecated_reasonr"   $deprecated_opt_with_deprecated_sincetune_inz13.0)r9   deprecated_since$deprecated_opt_with_deprecated_group)r7   deprecated_groupr"   opt_with_DeprecatedOptzOpt with DeprecatedOpt)group)r"   deprecated_optsunknown_typeunknown_opt123unknownzunknown type)	type_name)r3   r"   typestr_optzfoo bara stringr3   r"   str_opt_sample_default	fooishbarstr_opt_with_spacez  foo bar  za string with spacesstr_opt_multilinezfoo
bar
bazza string with newlinesbool_opt	a booleanint_opt
         
an integer)r3   minmaxr"   int_opt_min_0r   int_opt_max_0)r3   rZ   r"   	float_optg?za floatlist_opt)123a listlist_opt_with_bounds)r3   r"   boundslist_opt_singler`   list_int_opt)rV         dict_optyesno)r`   ra   za dictip_optz	127.0.0.1zan ip addressport_optP   za porthostname_optzcompute01.nova.site1z
a hostnameuri_optzhttp://example.comza URI	multi_optzmultiple stringsmulti_opt_nonemulti_opt_empty56)r3   sample_defaultr"   string_type_with_bad_defaultzstring with bad defaulti   r"   r3   native_str_typeznative help)r"   rJ   native_int_typenative_float_typer   zcustom helpcustom_opt_typezport numberi  zthis is a port)rJ   r3   r"   )rt   multi_opt_sample_defaultrx   rz   r{   r|   r   custom_type_nameempty
[DEFAULT]
optsexpectedsingle_namespacetestNzF[DEFAULT]

#
# From test
#

# foo option (string value)
#foo = <None>
multiple_namespacesotherz[DEFAULT]

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
rC   a\  [DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>
empty_groupmultiple_groupsa  [DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>


[group2]

#
# From test
#

# bar option (string value)
#bar = <None>
group_in_multiple_namespacesa  [DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
hyphenated_namezF[DEFAULT]

#
# From test
#

# foobar (string value)
#foo_bar = <None>
)z"%s" is missing a help stringr,   z?[DEFAULT]

#
# From test
#

# (string value)
#no_help = <None>
)r   log_warningr   a  [DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in
# reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
# pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
# culpa qui officia deserunt mollit anim id est laborum. (string
# value)
#long_help = <None>
long_help_wrap_at_40(   a  [DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet,
# consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et
# dolore magna aliqua. Ut enim ad minim
# veniam, quis nostrud exercitation
# ullamco laboris nisi ut aliquip ex ea
# commodo consequat. Duis aute irure
# dolor in reprehenderit in voluptate
# velit esse cillum dolore eu fugiat
# nulla pariatur. Excepteur sint
# occaecat cupidatat non proident, sunt
# in culpa qui officia deserunt mollit
# anim id est laborum. (string value)
#long_help = <None>
)r   
wrap_widthr   long_help_no_wrappinga   [DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. (string value)
#long_help = <None>
long_help_with_preformattingF   aR  [DEFAULT]

#
# From test
#

# This is a very long help text which is preformatted with line
# breaks. It should break when it is too long but also keep the
# specified line breaks. This makes it possible to create lists with
# items:
#
# * item 1
# * item 2
#
# and should increase the readability. (string value)
#long_help_pre = <None>
a  [DEFAULT]

#
# From test
#

# a string with choices (string value)
# Possible values:
# <None> - <No description provided>
# '' - <No description provided>
# a - <No description provided>
# b - <No description provided>
# c - <No description provided>
#choices_opt = a
z'deprecated opt without deprecated groupz[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [foo]/foobar
#bar = <None>
r9   z[DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: deprecated for removal (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#bar = <None>
r<   a1  [DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: Turn off stove (boolean value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
# Reason: This was supposed to work but it really, really did not.
# Always buy house insurance.
#turn_off_stove = false
z[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [group1]/foobar
#bar = <None>
zH[DEFAULT]

#
# From test
#

# unknown (unknown type)
#unknown_opt = 123
zI[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = foo bar
z[[DEFAULT]

#
# From test
#

# a string with spaces (string value)
#str_opt = "  foo bar  "
ze[DEFAULT]

#
# From test
#

# a string with newlines (string value)
#str_opt = foo
#    bar
#    baz
zJ[DEFAULT]

#
# From test
#

# a boolean (boolean value)
#bool_opt = false
zn[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
zt[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 0
# Maximum value: 20
#int_opt_min_0 = 10
z`[DEFAULT]

#
# From test
#

# an integer (integer value)
# Maximum value: 0
#int_opt_max_0 = -1
zN[DEFAULT]

#
# From test
#

# a float (floating point value)
#float_opt = 0.1
zD[DEFAULT]

#
# From test
#

# a list (list value)
#list_opt = 1,2,3
zR[DEFAULT]

#
# From test
#

# a list (list value)
#list_opt_with_bounds = [1,2,3]
zG[DEFAULT]

#
# From test
#

# a list (list value)
#list_opt_single = 1
zH[DEFAULT]

#
# From test
#

# a list (list value)
#list_int_opt = 1,2,3
zI[DEFAULT]

#
# From test
#

# a dict (dict value)
#dict_opt = 1:yes,2:no
zS[DEFAULT]

#
# From test
#

# an ip address (IP address value)
#ip_opt = 127.0.0.1
zk[DEFAULT]

#
# From test
#

# a port (port value)
# Minimum value: 0
# Maximum value: 65535
#port_opt = 80
z_[DEFAULT]

#
# From test
#

# a hostname (hostname value)
#hostname_opt = compute01.nova.site1
zk[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt = 1
#multi_opt = 2
#multi_opt = 3
zP[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_none =
zQ[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_empty =
zK[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = fooishbar
zS[DEFAULT]

#
# From test
#

# native help (string value)
#native_str_type = <None>
zT[DEFAULT]

#
# From test
#

# native help (integer value)
#native_int_type = <None>
z][DEFAULT]

#
# From test
#

# native help (floating point value)
#native_float_type = <None>
r~   z[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#
# This option has a sample default set, which means that
# its actual default value may vary from the one documented
# below.
#multi_opt = 5
#multi_opt = 6
r   zS[DEFAULT]

#
# From test
#

# this is a port (port number)
#custom_opt_type = 5511
zP[DEFAULT]

#
# From test
#

# custom help (unknown value)
#custom_type = <None>
zj[DEFAULT]

#
# From test
#

# string with bad default (string value)
#string_type_with_bad_default = 4096
str_opt_str_groupz[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# a string (string value)
#str_opt = foo bar

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
opt_str_opt_groupz[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10

#
# From test
#

# a string (string value)
#str_opt = foo bar
z[DEFAULT]

#
# From test
#

# Opt with DeprecatedOpt (boolean value)
# Deprecated group/name - [deprecated]/foo_bar
#foo_bar = <None>
stdout)r   r   r   zsample.conf)r   r   c                 b    t        j                  | j                  | j                        | _        y N)testscenariosmultiply_scenarioscontent_scenariosoutput_file_scenarios	scenariosclss    r   generate_scenariosz$GeneratorTestCase.generate_scenarios  s&    %88!!%%'r   c                 `   t         t        |           t        j                         | _        t        j                  | j
                        | _        | j                  j                  | _        | j                  | j                         | j                  t        j                               | _        y r   )superr   setUpr   r   r   config_fixtureConfigconfig
useFixturefixturesTempDirtempdirself	__class__s    r   r   zGeneratorTestCase.setUp  st    ,.NN$	,33DII>))00++,x'7'7'9:r   c                     | j                  t        j                  d|z  t        j                                      t        t        |      S )Nzsys.%s)r   r   MonkeyPatchioStringIOgetattrsys)r   stream_names     r   _capture_streamz!GeneratorTestCase._capture_stream  s8    ,,X-C-/[[]< 	=sK((r   c                 $    | j                  d      S )Nr   )r   r   s    r   _capture_stdoutz!GeneratorTestCase._capture_stdout  s    ##H--r   _get_raw_opts_loadersLOGc                 F   t        j                  | j                         | j                  D cg c]  }|d   	 }}| j	                  |       | j
                  j                         D ]  }| j                  j                  |        t        | dd       }|| j	                  |       | j                  r| j                         }n7| j                  j                  | j                        }| j	                  |       | j                  D 	
cg c]  \  }	}
|	|
fdf c}
}	|_        t        j                  | j                         | j                  r+| j!                  | j"                  j%                                nAt'        d      5 }|j)                         }d d d        | j!                  | j"                         t        | dd       }| |j*                  j,                  |  y | j/                  |j*                  j0                         y c c}w c c}
}	w # 1 sw Y   xY w)	Nr   )	namespacer   )r   r   c                     | S r   r
   r   s    r   <lambda>z1GeneratorTestCase.test_generate.<locals>.<lambda>      4 r   rr   )r   register_cli_optsr   r   r   groupsvaluesregister_groupr   r   r   r   joinr   return_valuegenerateassertEqualr   getvalueopenreadwarningassert_called_once_withassertFalsecalled)r   mock_lograw_opts_loaderi
namespacesrC   r   r   r   nsr   factualr   s                 r   test_generatezGeneratorTestCase.test_generate  s    	##DII.$(II.qad.
.j)[['') 	,EII$$U+	, T<6
!KK:K.;;))+F,,++D,<,<=KKKKK0 !II(
D T'((
$
 	499%;;T]]FOO,=>k3' "1"T]]F3dM48"4H44kBX--445S /.(
" "s   HHHH ))__name__
__module____qualname__r   OptGroupr   StrOptBoolOptDeprecatedOptOptr   StringIntOptFloatOptListOptDictOptIPOptPortOptHostnameOptURIOptMultiStrOptstrintfloatr   Integerr   dictr   r   classmethodr   r   r   r   r   patchobjectr   r   __classcell__r   s   @r   r   r   1   s    #,,H%KL #,,HI>s||k
KF\zszz%l3\zszz%l3\ 	:3::ih7\ 	:3::i(	\
 	ZSZZ&01\& 	O*89'\@ 	zszz-*-*C'>@A\H 	2:3::8,4@I\L 	%jcjj$5M'OM\P 	 #'L-"/Q\^ 	/#'#1%_\f 	/


8h1g\l 	!+#++).S..y5AC D#Em\x 	(-%.%1U\\N%KMy\@ 	:3::i&/#-/A\F 	!*#**Y5@2<#>G\L 	jcjj1>.DFM\R 	ZSZZ	0?-EGS\X 	KCKK
(-%02Y\^ 	:3::i&("#"$#/	1_\h 	O,.()(*)5	7i\r 	O,.())57s\z 	\S\\+*-'02{\@ 	KCKK
(7%-/A\F 	,B4C1937!9G\N 	;3;;'8/2,46O\T 	N,5)13U\Z 	KCKK
.3$(?%-/[\` 	)#))H$/!02a\f 	KCKK
(*%-/g\l 	0F-9;m\r 	:3::i&:#*,s\x 	_S__[-<*<>y\~ 	/#//*:/AC\B +3??+<350BD %4COOK<KDG:9K%M )00N5N8<)> #377#4(5(+- #377#4(5(+- %SWW%8*7*/1 sww}$1$/1 $CGG$5)6 BA *B,0)9	;o\D|M		2 ! 
	M 
	Vtd5k]3456	

		M 
	Vtd5k]345tE{m4568
	MD 
	Vvh/$u+?@AB
	EMh 
	Vvh/4567
	iMp 
	Vvh/$u+?%h/$u+?A B C
	qMj 
(	Vvh/$u+?@Ax 04;-@ABD
	kM^ 
	Vtd9o%6789:	

	_Mt 
	Vtd9o%6789:F

	uML 
	Vtd;&7%89:;<
	MMp 
 	Vtd;&7%89:;<
	qM` 
!	Vtd;&7%89:;<
	aMH 
(	Vtd?&;%<=>?@
	IMp 
	Vtd=&9%:;<=>
	qMR 
3	Ve}FGHJ KL M
	SMv 
"	Vve}#$@ABD E F G
	wMZ 
	Vve}#$;<=? @ A B
	[MB	 
0	Ve}CDEG HI J
	C	Mf	 
	Vtd>&:%;<=>?	

	g	M|	 
	Vtd9o%6789:	

	}	MR
 
	Vtd+?&@%ABCDE	

	S
Mh
 
	Vtd+>&?%@ABCD

	i
MB 
	Vtd:&6%789:;	

	CMX 
	Vtd9o%6789:

	YMr 
	Vtd?&;%<=>?@

	sML 
	Vtd?&;%<=>?@	

	MMf 
	Vtd;&7%89:;<	

	gM| 
	Vtd:&6%789:;	

	}MR 
 	Vtd+A&B%CDEFG	

	SMh 
	Vtd+<&=%>?@AB	

	iM~ 
	Vtd>&:%;<=>?	

	MT 
	Vtd:&6%789:;	

	UMj 
	Vtd8n%56789	

	kM@ 
	Vtd:&6%789:;

	AMZ 
	Vtd>&:%;<=>?	

	[Mp 
	Vtd;&7%89:;<

	qMJ 
	Vtd+;&<%=>?@A	

	KM` 
	Vtd+<&=%>?@AB	

	aMv 
"	Vtd+C&D%EFGHI	

	wML 
	Vtd+<&=%>?@AB	

	MMb 
	Vtd+<&=%>?@AB	

	cMx 
	Vtd+>&?%@ABCD	

	yMN 
$	Vtd+E&F%GHIJK
	OMn 
	Vtd+=&>%?@ABC	

	oMD 
	Vtd=&9%:;<=>	

	EMZ 
(	Vt $%C DEG H I J

	[Mr 
	Vu $Y02%e} $Y023 4 e#J/02 3 4	5"
#	sMz 
	Vve} $Y02$ $Y023 4 fUm#J/02 3 4	5"
#	{MB 
"	Vtd+C&D%EFGHI	

	CM` 
	Tt	,	.		-	6	8 ' '
;)
. 
ZZy"9:	ZZy%(,6 ) ;,6r   r   c                   "    e Zd Z fdZej
                  j                  ed      ej
                  j                  ed      d               Zej
                  j                  ed      ej
                  j                  ed      d               Z	 xZ
S )GeneratorFileHandlingTestCasec                     t         t        |           t        j                         | _        t        j                  | j
                        | _        | j                  j                  | _        y r   )	r   r   r   r   r   r   r   r   r   r   s    r   r   z#GeneratorFileHandlingTestCase.setUp  sI    +T8:NN$	,33DII>))00r   _get_groups
_list_optsc                    t        j                  | j                         | j                  d       t	        j
                         }t	        j                         |_        t        j                  j                  t         d|d      5  t        j                  | j                  d        d d d         |       j                  j                          y # 1 sw Y   )xY w)Nsomefiler   r   T)create)r   r   r   r   r   	mock_openMockcloser   r   r   assert_called_oncer   r   r1   ms       r   test_close_generated_filez7GeneratorFileHandlingTestCase.test_close_generated_file  s     	##DII.
+NN))+ZZy&!DA 	<tyyd;	< 	
		$$&	< 	<s   "CCc                 
   t        j                  | j                         | j                          t	        j
                         }t        j                  | j                  |        |       j                  j                          y r   )	r   r   r   r   r   r   r   r   assert_not_calledr  s       r   test_not_close_external_filez:GeneratorFileHandlingTestCase.test_not_close_external_file  sP     	##DII.IIK499!4			##%r   )r   r   r   r   r   r   r   r   r  r  r   r   s   @r   r   r     s    1 
ZZy-0	ZZy,/
' 0 1
' 
ZZy-0	ZZy,/& 0 1&r   r   c                        e Zd Z fdZej
                  j                  ed      ej
                  j                  ed      ej
                  j                  ed      d                      Z xZ	S )DriverOptionTestCasec                    t         t        |           t        j                         | _        t        j                  | j
                        | _        | j                  j                  | _        | j                  | j                         y r   )
r   r  r   r   r   r   r   r   r   r   r   s    r   r   zDriverOptionTestCase.setUp"  s[    "D/1NN$	,33DII>))00++,r   _get_driver_opts_loadersr   r   c                   
 t        j                  ddd      t        j                  dd      t        j                  dd      gt        j                  d	d      gt        j                  d
d      gd
dfdfg|_        d
fdfg|_        t        j                  | j                         | j                  dgd       t        j                         }t        j                  | j                  |       |j                         }t        j                  |      }|d   d   }| j                  d|d          |d   D cg c]  }|d   	 }	}| j                  g d|	       | j                  d	gd
gd|d          y c c}w )N
test_groupz
Test Groupr%   )r!   r$   driver_optionr&   r'   r(   r)   d1-food2-foo)d1d2testingc                       fgS r   r
   )rC   regular_optss   r   r   z9DriverOptionTestCase.test_driver_option.<locals>.<lambda>I  s    %!6 7 r   c                       S r   r
   )driver_optss   r   r   z9DriverOptionTestCase.test_driver_option.<locals>.<lambda>L  s     r   test_generatoryamlr   format_r   optionsr  r   r!   )r%   r(   r  r  r  )r   r   r   r   r   r   r   r   r   r   r   r   r   r  	safe_loadr   )r   r   r   driver_opts_loaderr   bodyr   test_sectionofound_option_namesr  rC   r  s             @@@r   test_driver_optionz'DriverOptionTestCase.test_driver_option*  s   
 
 OOE5JJu<0
 

8,7 

8,7	
" 78(
$ +,+
'
 	##DII./0&A 	499&9 %i(6_ => "&)
 fI
 
 	.	
 	:hZ0'	

s   F)
r   r   r   r   r   r   r   r   r"  r   r   s   @r   r  r     sa    - 
ZZy"<=	ZZy"9:	ZZy%(:
 ) ; >:
r   r  r  Fr   r   )r  minimalr   r   	summarizer   config_sourcec                       e Zd Zej                  Zej                  Zd edded   gfgfgi e	ddi dddgi ddd	g d
ddddg 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gdid      fd edded   gfgfgi e	ddi dddgi ddd	g d
ddddg ddddddded   j                  dddddddddddddddddddddgdid      fd  edded    gfgfgi e	ddi ddd gi ddd	g d
ddddg dddddd ded    j                  dddddddddd dddddddddddgdid      fd! edded!   gfgfgd"d#dd$d%gie	ddi ddd$gi ddd	g d
ddddd"d#d&gdddddd#ded!   j                  dddddddddd$dddddddddd'dgdid      fd( edded(   gfgfgi e	ddi ddd(gi ddd	g d)d
d*dddg dddddd(ded(   j                  dddddddddd(dddddddddddgdid      fd+ edded+   gfgfgi e	ddi ddd+gi ddd	g d
d,dddg dddddd+ded+   j                  dd-dddd.dddd+dddddddddd/dgdid      fd0 eded1   ed   gfgfgi e	dg g d2di ded1   j                  dgi ddd	g d
ddddg ddddddded   j                  dddddddddddddddddddddgdd3d      fgZ fd4Zed5        Zej                   j#                  ed6      d7        Z xZS )8 MachineReadableGeneratorTestCaser   r   Nr%   DEFAULTr0   advancedFr4   r3   r9   rD   r<   r?   destr"   r&   rZ   metavarrY   mutabler!   r   
positionalrequiredzstring value)rw   secretshortrJ   )r  r  dynamic_group_ownerr"   standard_optsr   )deprecated_optionsgenerator_optionsr  r   r-   r.   rB   r6   foo_barr*   )r!   replacement_groupreplacement_name)rC   r!   zboolean valuer/   ))NN)r0   N)r   N)r1   N)r2   Nr   rT   rU   rW   rV   zinteger value
group_helpr    )r"   r2  r   )r(  r    c                    t         t        |           t        j                         | _        t        j                  | j
                        | _        | j                  j                  | _        | j                  | j                         y r   )
r   r'  r   r   r   r   r   r   r   r   r   s    r   r   z&MachineReadableGeneratorTestCase.setUpo  s[    .;=NN$	,33DII>))00++,r   c                 L    t        j                  | j                        | _        y r   )r   r   r   r   r   s    r   r   z3MachineReadableGeneratorTestCase.generate_scenariosw  s    %88!!#r   r   c                    t        j                  | j                         | j                  D cg c]  }|d   	 }}| j	                  |d       | j                  D cg c]  \  }}||fdf c}}|_        t        j                  t        j                  | j                  j                              }| j                  | j                  t        j                  || j                               y c c}w c c}}w )Nr   r  r  c                     | S r   r
   r   s    r   r   z@MachineReadableGeneratorTestCase.test_generate.<locals>.<lambda>  r   r   )r   r   r   r   r   r   r   r   r   r   r   _generate_machine_readable_data)r   r   r   r   r   r   test_groupss          r   r   z.MachineReadableGeneratorTestCase.test_generate|  s    ##DII.$(II.qad.
.j&9 !II(
D T'((
$  ++  !4!457"BB;CG99N	O! /(
s   C/C4)r   r   r   r   r   all_optsr   
all_groupsr   GENERATOR_OPTSr"   r   r   r   r   r   r   r   r   r   r   r   s   @r   r'  r'  s  s$
    %%H"))J		Vthuo%6789:.0-;%13/179(*27*B*e *B*3R*B*3T*B +CE*B +<R	*B
 +>t*B +=d*B +1%*B +1,*B +0*B +4T*B +0*B +4U*B +1%*B +6v*B +7*B  +5e!*B" =A49372@)*B )C(D$EF
G	H@ 
	Vth{&;%<=>?@.0-;%13/179(*2=*B*e *B*3R*B*3T*B +CE*B +<R	*B
 +>t*B +=d*B +1+*B +1(;2G2L2L*B +0*B +4T*B +0*B +4U*B +1+*B +6v*B +7*B  +5e!*B" =A49372@)*B )C(D$EF
G	H@ 
	Vth&?%@ABCD.0-;%13/179(*2A1B*B*e *B*3R*B*3T*B +CE*B +<R	*B
 +>t*B +=d*B +1/*B +1.6.G.L.L*B +0*B +4T*B +0*B +4U*B +1/*B +6v*B  +7!*B" +5e#*B$ =A49372@+*B )C(D$EF
G 	HB 
"	Vth/G&H%IJKLM #i;D:C&E %F)G (6+-)+13"$,5;$7(%$7'$7 ($7 7	$7
 0L;D3F 2G$7 24$7 1$$7 %i$7 %"*+C"D"I"I$7 $T$7 ($7 $T$7 ($7  %i!$7" *6#$7$ +E%$7& )%'$7( 15(-'+&5/$7 #8"9:$;%
<&	=N 
	Vth}&=%>?@AB.0-;%13/179(*2?*B*e *B*3 6,*B +4S*B +CE*B +<R*B +>t*B +=d*B +1-*B +1(=2I2N2N*B +0*B  +4T!*B" +0#*B$ +4U%*B& +1-'*B( +6v)*B* +7+*B, +5e-*B. =A49372@5*B )C (D!$E#F$
G%	HL 
	Vthy&9%:;<=>.0-;%13/179(*2;*C*e *C*3R*C*3R*C +CE*C +<R	*C
 +>t*C +=d*C +1)*C +1(92E2J2J*C +0*C +4T*C +0*C +4U*C +1)*C +6v*C +7*C  +5e!*C" =A49372A)*C )D(E$FG
H	I@ 
	Vz(3huo5FGHIJ.0-; )+13(*( 24/179(28(<(A(A27*B*e *B*3R*B*3T*B +CE*B +<R	*B
 +>t*B +=d*B +1%*B +1(5/2F2F*B +0*B +4T*B +0*B +4U*B +1%*B +6v*B +7*B  +5e!*B" =A49372@)*B )C'D#$E%F&
G'	H_w
r- # # 
ZZy"9:O ;Or   r'  c            	       V   e Zd Z ej                  dd       ej                  dd       ej                  dd       ej                  dd	       ej
                  d
d       ej                  dd      gZd Zd Z	d Z
d Zd Zej                  j                  ed      d        Zy)IgnoreDoublesTestCaser%   r&   r'   r(   r)   r5  r+   rK   rL   rR   rS   rT   rX   c                 r    dd| j                   fgfg}| j                  |t        j                  |             y )N
namespace1r    r   r   r   _cleanup_opts)r   r   s     r   test_cleanup_opts_defaultz/IgnoreDoublesTestCase.test_cleanup_opts_default  s=    #% & 'I33A67r   c                     dd| j                   | j                   d   gz   fgfg}dd| j                   fgfg}| j                  |t        j                  |             y )NrE  r    r   rF  r   r   es      r   test_cleanup_opts_dup_optz/IgnoreDoublesTestCase.test_cleanup_opts_dup_opt  sl    diil^346 7 8#% & 'I33A67r   c                 B   dd| j                   | j                   d   gz   fd| j                   fd| j                   | j                   d   gz   fgfg}dd| j                   fd| j                   fd| j                   fgfg}| j                  |t        j                  |             y )NrE  r    rV   r#   group3rh   rF  rJ  s      r    test_cleanup_opts_dup_groups_optz6IgnoreDoublesTestCase.test_cleanup_opts_dup_groups_opt  s    diil^34#diil^346 7 8 ###% & ' 	I33A67r   c           
         dd| j                   fd| j                   | j                   d   gz   fd| j                   | j                   d   gz   fd| j                   | j                   d   gz   fd| j                   fd	| j                   | j                   d   gz   fgfg}dd| j                   fd| j                   fgfg}| j                  |t        j                  |             y )
NrE  r3   DefaultrV   r(  rh   r    Group1GROUP1rF  rJ  s      r   +test_cleanup_opts_dup_mixed_case_groups_optzAIgnoreDoublesTestCase.test_cleanup_opts_dup_mixed_case_groups_opt  s    $))$$))tyy|n45$))tyy|n45diil^34#diil^346 7 8 $))$#% & ' 	I33A67r   c                    dd| j                   | j                   d   gz   fd| j                   fgfdd| j                   | j                   d   gz   fd| j                   fgfg}dd| j                   fd| j                   fgfdd| j                   fd| j                   fgfg}| j                  |t        j                  |             y )NrE  r    rV   r#   
namespace2rh   rF  rJ  s      r   +test_cleanup_opts_dup_namespace_groups_optszAIgnoreDoublesTestCase.test_cleanup_opts_dup_namespace_groups_opts  s    diil^34#% & diil^34#% &' ##% & ##% &' 	I33A67r   r   c                    d t        j                  d      t        j                  d      gfgdfdfdfdfg|_        d}t        j                  dg      D ]  \  }}|D ]  \  }}|t        |      z  }  | j                  d|       y )Nr%   r(   r   c                       S r   r
   config_optss   r   r   zAIgnoreDoublesTestCase.test_list_ignores_doubles.<locals>.<lambda>      + r   c                       S r   r
   rZ  s   r   r   zAIgnoreDoublesTestCase.test_list_ignores_doubles.<locals>.<lambda>  r\  r   r   rh   )r   r   r   r   r   lenr   )r   raw_opts_loadersslurped_opts_listingr   r[  s         @r   test_list_ignores_doublesz/IgnoreDoublesTestCase.test_list_ignores_doubles  s     CJJu%szz%'89:
 -.-.)
%
 #..}= 	*JAw" *4D	)*	* 	L)r   N)r   r   r   r   r   r   r   r   rH  rL  rO  rT  rW  r   r   r   r   rc  r
   r   r   rC  rC    s    CJJu<0CJJu<0CJJyx0CJJyz2CKK
5CJJy|46D8
8	888 
ZZy"9:* ;*r   rC  c            	       &   e Zd Z ej                  ddd       ej                  dd       ej                  dd	       ej                  d
d       ej
                  dd       ej                  dd      gZd Zd Z	d Z
d Zd Zd Zd Zd Zy)GeneratorAdditionalTestCaser%   r&   fredry   r(   r)   r'   r5  r+   rK   rL   rR   rS   rT   rX   c                 \    t        j                  g       }| j                  dd g di|       y )Nr(  )r   r   )r   r   r   )r   r   s     r   test_get_groups_empty_nsz4GeneratorAdditionalTestCase.test_get_groups_empty_ns  s/    &&r*)B%GH	!r   c                     dd| j                   fd| j                   fgfg}t        j                  |      }| j                  g dt	        |             y )NrE  betaalpha)r(  rk  rj  r   r   r   r   sortedr   r   r   s      r   test_get_groups_single_nsz5GeneratorAdditionalTestCase.test_get_groups_single_ns  sU    DII&TYY'") * + &&v.5vf~Fr   c                     dd| j                   fd| j                   fgfdd| j                   fd| j                   fgfg}t        j                  |      }| j                  g dt	        |             y )NrE  rj  rk  rV  gamma)r(  rk  rj  rq  rl  rn  s      r   test_get_groups_multiple_nsz7GeneratorAdditionalTestCase.test_get_groups_multiple_ns  s|    DII&TYY'") *  TYY'TYY'") *+ &&v.>vOr   c                    ddg fgfg}t        j                  |      }t        j                         \  }}t	        |d      5 }t        |      }t        j                  |d|j                  d             d d d        d}t	        |d      5 }|j                         }d d d        | j                  |       y # 1 sw Y   CxY w# 1 sw Y   (xY w)NrE  rk  w+r(  r   r   )
r   r   tempfilemkstempr   r   _output_optspopr   r   	r   r   r   fdtmp_filer   	formatterr   r   s	            r   test_output_opts_empty_defaultz:GeneratorAdditionalTestCase.test_output_opts_empty_default  s    R="" # $&&v.'')H(D! 	PQ'*I""9iI9NO	P(C  	AVVXF	6*	P 	P
	 	s   2B5	C5B>C
c                    dd| j                   d   gfgfg}t        j                  |      }t        j                         \  }}t        |d      5 }t        |      }t        j                  |d|j                  d             d d d        d}t        |d      5 }|j                         }d d d        | j                  |       y # 1 sw Y   CxY w# 1 sw Y   (xY w)NrE  rk  r   rt  zH[alpha]

#
# From namespace1
#

# foo option (string value)
#foo = fred
r   r   r   r   ru  rv  r   r   rw  rx  r   r   ry  s	            r   test_output_opts_groupz2GeneratorAdditionalTestCase.test_output_opts_group  s    diil^,". / 0&&v.'')H(D! 	LQ'*I""9gvzz'7JK	L (C  	AVVXF	6*	L 	L	 	s   2CCCCc                    t        j                  dd|      }dd|gfgfg}t        j                  |      }t	        j
                         \  }}t        |d      }t        |      }dd|iz  }	t        j                  |d|j                  d             |j                          t        |      j                         }
| j                  |	|
       y )	Nr_   rc   ry   rE  rk  rt  zN[alpha]

#
# From namespace1
#

# a list (list value)
#list_opt = %(default)s
r3   )r   r   r   r   ru  rv  r   r   rw  rx  r   r   r   )r   r3   optr   r   rz  r{  r   r|  r   contents              r   /_test_output_default_list_opt_with_string_valuezKGeneratorAdditionalTestCase._test_output_default_list_opt_with_string_value+  s    kk*8WEcU#"% & '&&v.'')H4 #A&	 ' 	y'6::g3FG		x.%%'7+r   c                 &    | j                  d       y )Nzfoo,barr  r   s    r   ?test_output_default_list_opt_with_string_value_multiple_entriesz[GeneratorAdditionalTestCase.test_output_default_list_opt_with_string_value_multiple_entriesB  s    <<YGr   c                 &    | j                  d       y )Nr%   r  r   s    r   ;test_output_default_list_opt_with_string_value_single_entryzWGeneratorAdditionalTestCase.test_output_default_list_opt_with_string_value_single_entryE  s    <<UCr   N)r   r   r   r   r   r   r   r   rh  ro  rr  r}  r  r  r  r  r
   r   r   re  re    s    CJJu<@CJJu<0CJJyx0CJJyz2CKK
5CJJy|46D!
GP+ +.,.HDr   re  c                       e Zd Zd Zd Zy)GeneratorMutableOptionTestCasec                     t        j                         }t        j                  ddd      }t	        |      }|j                  |d       |j                         }| j                  d|       y )Nr%   r&   Tr"   r,  r    .This option can be changed without restarting.)r   r   r   r   r   formatr   assertInr   outr  genresults        r   test_include_messagez3GeneratorMutableOptionTestCase.test_include_messageK  sT    kkmjj\4@c"

3!<	
r   c                     t        j                         }t        j                  ddd      }t	        |      }|j                  |d       |j                         }| j                  d|       y )Nr%   r&   Fr  r    r  )r   r   r   r   r   r  r   assertNotInr  s        r   test_do_not_include_messagez:GeneratorMutableOptionTestCase.test_do_not_include_messageV  sV    kkmjj\5Ac"

3!<	
r   N)r   r   r   r  r  r
   r   r   r  r  I  s    	
	
r   r  c                       e Zd Zd Zd Zy)GeneratorRaiseErrorTestCasec                     G d dt                G fdd      } |       }t        j                         | _        | j                  j	                  t
        j                         | j                  j                  d|j                  g       t        j                  d              5  | j                  t
        j                  | j                         ddd       y# 1 sw Y   yxY w)	z?Verifies that errors from extension manager are not suppressed.c                       e Zd Zy)NGeneratorRaiseErrorTestCase.test_generator_raises_error.<locals>.FakeExceptionN)r   r   r   r
   r   r   FakeExceptionr  f  s    r   r  c                       e Zd Zd Z fdZy)GGeneratorRaiseErrorTestCase.test_generator_raises_error.<locals>.FakeEPc                 V    d| _         | j                  | _        | j                  | _        y )Ncallback_is_expected)r!   resolverequireloadr   s    r   __init__zPGeneratorRaiseErrorTestCase.test_generator_raises_error.<locals>.FakeEP.__init__k  s    2	#|| LL	r   c                             r   r
   )r   argsr   r  s      r   r  zOGeneratorRaiseErrorTestCase.test_generator_raises_error.<locals>.FakeEP.resolvep  s    #o%r   N)r   r   r   r  r  )r  s   r   FakeEPr  i  s    )
&r   r  r   z%stevedore.named.NamedExtensionManager)side_effectN)	Exceptionr   r   r   r   r   r   set_defaultr!   r   r   assertRaisesr   )r   r  fake_epr  s      @r   test_generator_raises_errorz7GeneratorRaiseErrorTestCase.test_generator_raises_errord  s    	I 		& 	& (NN$				 9 9:		kGLL>:ZZ?$1O5 	LmY-?-?K	L 	L 	Ls   ),CC'c                     dg}t        j                  d|      5  | j                  t        t        j
                  g        d d d        y # 1 sw Y   y xY w)Nzoslo-config-generatorzsys.argv)r   r   r  
SystemExitr   main)r   testargss     r   8test_generator_call_with_no_arguments_raises_system_exitzTGeneratorRaiseErrorTestCase.test_generator_call_with_no_arguments_raises_system_exit{  sC    +,ZZ
H- 	>j).."=	> 	> 	>s   &A		AN)r   r   r   r  r  r
   r   r   r  r  b  s    L.>r   r  c                      e Zd Zej                  j                  ed      ej                  j                  ed      d               Zej                  j                  ed      ej                  j                  ed      d               Zy)ChangeDefaultsTestCase_get_opt_default_updatersr   c                    t        j                  dd      dfdfg|_        g |_        t        j                  dg      }|d   d   d   d   d   }| j                  d|j                         | j                  |       y )Nr%   r(   r3   r   c                      d  gfgS r   r
   orig_opts   r   r   zEChangeDefaultsTestCase.test_no_modifiers_registered.<locals>.<lambda>      D8*#5"6 r   r   rV   r   r   r   r   r   r   r3   assertIs)r   r_  get_updatersr   the_optr  s        @r   test_no_modifiers_registeredz3ChangeDefaultsTestCase.test_no_modifiers_registered  s     ::eU367)
% %'!##[M2q'!*Q-"1%0h(r   c                    t        j                  dd      dfdfg|_        fd}|g|_        t        j                  dg      }|d   d   d   d   d   }| j                  d	|j                         | j                  |       y )
Nr%   r(   r  r   c                      d  gfgS r   r
   r  s   r   r   z<ChangeDefaultsTestCase.test_change_default.<locals>.<lambda>  r  r   c                  6    t        j                   gd       y )Nblah)r%   )r   set_defaultsr  s   r   updaterz;ChangeDefaultsTestCase.test_change_default.<locals>.updater  s    hZV4r   r   rV   r  r  )r   r_  r  r  r   r  r  s         @r   test_change_defaultz*ChangeDefaultsTestCase.test_change_default  s     ::eU367)
%	5 &-I!##[M2q'!*Q-"1%1h(r   N)	r   r   r   r   r   r   r   r  r  r
   r   r   r  r    s    	ZZy"=>	ZZy"9:) ; ?) 
ZZy"=>	ZZy"9:) ; ?)r   r  c                       e Zd Z ej                  ddd       ej                  ddd       ej                  d	d
       ej                  ddd      gZd Zy)RequiredOptionTestCaser%   r&   rf  ry   r(   r)   T)r"   r.  r5  r+   r'   barsbars fooc                    dd| j                   fgfg}t        j                  |      }t        j                         \  }}t        |d      5 }t        |d      }t        j                  |d|j                  d             d d d        d}t        |d      5 }|j                         }d d d        | j                  |       y # 1 sw Y   CxY w# 1 sw Y   (xY w)NrE  rk  rt  T)r#  zr[alpha]

#
# From namespace1
#

# bar option (string value)
bar = <None>

# bars foo (string value)
bars = <None>
r   r  ry  s	            r   $test_required_option_order_single_nsz;RequiredOptionTestCase.test_required_option_order_single_ns  s    TYY'") * +&&v.'')H(D! 	8Q'48I""9#*#)::g#68	8
 (C  	AVVXF	6*'	8 	8"	 	   4CCC
CN)r   r   r   r   r   r   r  r
   r   r   r  r    sU    CJJu<@CJJu<$?CJJyx0CJJvJ>@D
+r   r  c                   j    e Zd ZdZ ej
                  ddd       ej
                  ddd	      gZd
 Zy)SummarizedOptionsTestCasezValidate 'summarize' config option.

    The 'summarize' switch ensures only summaries of each configuration
    option are output.
    r%   rf  af  This is the summary line for a config option.

I can provide a lot more detail here, but I may not want to bloat my
config file. In this scenario, I can use the 'summarize' config option
to ensure only a summary of the option is output to the config file.
However, the Sphinx-generated documentation, hosted online, remains
unchanged.

Hopefully this works.
rM   r(   TzThis is a less carefully formatted configuration
option, where the author has not broken their description into a brief
summary line and larger description. Watch this person's commit
messages!)r.  r"   c                    dd| j                   fgfg}t        j                  |      }t        j                         \  }}t        |d      5 }t        |d      }t        j                  |d|j                  d             d d d        d}t        |d      5 }|j                         }d d d        | j                  |       y # 1 sw Y   CxY w# 1 sw Y   (xY w)NrE  rk  rt  T)r$  a  [alpha]

#
# From namespace1
#

# This is the summary line for a config option. For more information,
# refer to the documentation. (string value)
#foo = fred

# This is a less carefully formatted configuration
# option, where the author has not broken their description into a
# brief
# summary line and larger description. Watch this person's commit
# messages! (string value)
#bar = <None>
r   r  ry  s	            r   &test_summarized_option_order_single_nsz@SummarizedOptionsTestCase.test_summarized_option_order_single_ns  s    7DII"6!789&&v.'')H(D! 	8Q'T:I""9#*#)::g#68	8
" (C  	AVVXF	6*1	8 	8,	 	r  N)r   r   r   __doc__r   r   r   r  r
   r   r   r  r    sI     	

		 	

	D,+r   r  c            	           e Zd Z ej                  ddd       ej                  ddd       ej                  d	d
       ej
                  dddd      gZd Zy)AdvancedOptionsTestCaser%   r&   rf  ry   r(   r)   T)r"   r)  r5  r+   r'   r  r  )r"   r3   r)  c                    dd| j                   fgfg}t        j                  |      }t        j                         \  }}t        |d      5 }t        |      }t        j                  |d|j                  d             d d d        d}t        |d      5 }|j                         }d d d        | j                  |       y # 1 sw Y   CxY w# 1 sw Y   (xY w)NrE  rk  rt  a  [alpha]

#
# From namespace1
#

# foo option (string value)
#foo = fred

# foobar (string value)
#foo_bar = <None>

# bar option (string value)
# Advanced Option: intended for advanced users and not used
# by the majority of users, and might have a significant
# effect on stability and/or performance.
#bar = <None>

# bars foo (boolean value)
# Advanced Option: intended for advanced users and not used
# by the majority of users, and might have a significant
# effect on stability and/or performance.
#bars = true
r   r  ry  s	            r   $test_advanced_option_order_single_nsz<AdvancedOptionsTestCase.test_advanced_option_order_single_ns  s    TYY'") * +&&v.'')H(D! 	LQ'*I""9gvzz'7JK	L0 (C  	AVVXF	6*;	L 	L6	 	s   2B?C?CCN)r   r   r   r   r   r   r   r  r
   r   r   r  r  
  sW    CJJu<@CJJu<$?CJJyx0CKKZMOD
$+r   r  c                   >    e Zd Z ej                  ddd      gZd Zy)HostAddressTestCaser%   r&   0.0.0.0ry   c                 f   dd| j                   fgfg}t        j                  |      }t        j                         }t        |      }t        j                  |d|j                  d             |j                         }t        j                  d      j                         }| j                  ||       y )Nr   rk  z
        [alpha]

        #
        # From namespace
        #

        # foo option (host address value)
        #foo = 0.0.0.0
        r   r   r   r   r   r   rw  rx  r   textwrapdedentlstripr   r   r   r   r  r|  r  r   s          r   test_host_addressz%HostAddressTestCase.test_host_address<      '499!5 678&&v.kkm#C(	y'6::g3FG?? 	$ 	 VX 	 	6*r   N)r   r   r   r   HostAddressOptr   r  r
   r   r   r  r  8  s     Cu<KLD+r   r  c                   >    e Zd Z ej                  ddd      gZd Zy)HostDomainTestCaser%   r&   r  ry   c                 f   dd| j                   fgfg}t        j                  |      }t        j                         }t        |      }t        j                  |d|j                  d             |j                         }t        j                  d      j                         }| j                  ||       y )Nr   rk  z
        [alpha]

        #
        # From namespace
        #

        # foo option (host domain value)
        #foo = 0.0.0.0
        r  r  s          r   test_host_domainz#HostDomainTestCase.test_host_domainW  r  r   N)r   r   r   r   HostDomainOptr   r  r
   r   r   r  r  S  s     Ce,	JKD+r   r  )&r   r   r  unittestr   r   oslotestr   ru  r   oslo_configr   r   r   r   r   r  load_tests_apply_scenarios
load_testsr   r   BaseTestCaser   r   r  rA  r'  rC  re  r  r  r  r  r  r  r  r  r   r
   r   r   <module>r     s   
 
        1 !   55

BI6)) I6X &D$5$5  &FG
4,, G
T $" &x!%$ "#%'^Ot'8'8 ^OB	N*D-- N*baD$"3"3 aDH
T%6%6 
2>$"3"3 >>$)T.. $)N!+T.. !+H;+ 1 1 ;+|++d// ++\+$++ +6+** +6  $ $ &   3 3 5r   