@@ -82,13 +82,13 @@ def test_load_root(root_config_file):
82
82
'invocation_defaults' in config )
83
83
84
84
85
- def test_max_adobe_percentage (modify_root_config , caplog ):
85
+ def test_max_adobe_percentage (modify_root_config , cli_args ):
86
86
root_config_file = modify_root_config (['limits' , 'max_adobe_only_users' ], "50%" )
87
87
config = ConfigFileLoader .load_root_config (root_config_file )
88
88
assert ('limits' in config and 'max_adobe_only_users' in config ['limits' ] and
89
89
config ['limits' ]['max_adobe_only_users' ] == "50%" )
90
90
91
- args = app . process_args ([ '-c' , root_config_file ] )
91
+ args = cli_args ({ 'config_filename' : root_config_file } )
92
92
options = ConfigLoader (args ).get_rule_options ()
93
93
assert 'max_adobe_only_users' in options and options ['max_adobe_only_users' ] == '50%'
94
94
@@ -97,7 +97,7 @@ def test_max_adobe_percentage(modify_root_config, caplog):
97
97
ConfigLoader (args ).get_rule_options ()
98
98
99
99
100
- def test_additional_groups_config (modify_root_config , caplog ):
100
+ def test_additional_groups_config (modify_root_config , cli_args ):
101
101
addl_groups = [
102
102
{"source" : r"ACL-(.+)" , "target" : r"ACL-Grp-(\1)" },
103
103
{"source" : r"(.+)-ACL" , "target" : r"ACL-Grp-(\1)" },
@@ -107,17 +107,17 @@ def test_additional_groups_config(modify_root_config, caplog):
107
107
assert ('additional_groups' in config ['directory_users' ] and
108
108
len (config ['directory_users' ]['additional_groups' ]) == 2 )
109
109
110
- args = app . process_args ([ '-c' , root_config_file ] )
110
+ args = cli_args ({ 'config_filename' : root_config_file } )
111
111
options = ConfigLoader (args ).get_rule_options ()
112
112
assert addl_groups [0 ]['source' ] in options ['additional_groups' ][0 ]['source' ].pattern
113
113
assert addl_groups [1 ]['source' ] in options ['additional_groups' ][1 ]['source' ].pattern
114
114
115
115
116
- def test_twostep_config (tmp_config_files , modify_ldap_config , caplog ):
116
+ def test_twostep_config (tmp_config_files , modify_ldap_config , cli_args ):
117
117
(root_config_file , ldap_config_file , _ ) = tmp_config_files
118
118
modify_ldap_config (['two_steps_lookup' ], {})
119
119
120
- args = app . process_args ([ '-c' , root_config_file ] )
120
+ args = cli_args ({ 'config_filename' : root_config_file } )
121
121
122
122
# test invalid "two_steps_lookup" config
123
123
with pytest .raises (AssertionException ):
@@ -138,9 +138,9 @@ def test_twostep_config(tmp_config_files, modify_ldap_config, caplog):
138
138
assert options ['two_steps_lookup' ]['group_member_attribute_name' ] == 'member'
139
139
140
140
141
- def test_adobe_users_config (tmp_config_files , modify_root_config ):
141
+ def test_adobe_users_config (tmp_config_files , modify_root_config , cli_args ):
142
142
(root_config_file , _ , _ ) = tmp_config_files
143
- args = app . process_args ([ '-c' , root_config_file ] )
143
+ args = cli_args ({ 'config_filename' : root_config_file } )
144
144
145
145
# test default
146
146
config_loader = ConfigLoader (args )
@@ -157,7 +157,7 @@ def test_adobe_users_config(tmp_config_files, modify_root_config):
157
157
158
158
# test command line param
159
159
modify_root_config (['invocation_defaults' , 'adobe_users' ], "all" )
160
- args = app . process_args ([ '-c' , root_config_file , '--adobe-users' , 'mapped' ])
160
+ args = cli_args ({ 'config_filename' : root_config_file , 'adobe_users' : [ 'mapped' ]} )
161
161
config_loader = ConfigLoader (args )
162
162
options = config_loader .load_invocation_options ()
163
163
assert 'adobe_users' in options
0 commit comments