@@ -82,13 +82,13 @@ def test_load_root(root_config_file):
8282 'invocation_defaults' in config )
8383
8484
85- def test_max_adobe_percentage (modify_root_config , caplog ):
85+ def test_max_adobe_percentage (modify_root_config , cli_args ):
8686 root_config_file = modify_root_config (['limits' , 'max_adobe_only_users' ], "50%" )
8787 config = ConfigFileLoader .load_root_config (root_config_file )
8888 assert ('limits' in config and 'max_adobe_only_users' in config ['limits' ] and
8989 config ['limits' ]['max_adobe_only_users' ] == "50%" )
9090
91- args = app . process_args ([ '-c' , root_config_file ] )
91+ args = cli_args ({ 'config_filename' : root_config_file } )
9292 options = ConfigLoader (args ).get_rule_options ()
9393 assert 'max_adobe_only_users' in options and options ['max_adobe_only_users' ] == '50%'
9494
@@ -97,7 +97,7 @@ def test_max_adobe_percentage(modify_root_config, caplog):
9797 ConfigLoader (args ).get_rule_options ()
9898
9999
100- def test_additional_groups_config (modify_root_config , caplog ):
100+ def test_additional_groups_config (modify_root_config , cli_args ):
101101 addl_groups = [
102102 {"source" : r"ACL-(.+)" , "target" : r"ACL-Grp-(\1)" },
103103 {"source" : r"(.+)-ACL" , "target" : r"ACL-Grp-(\1)" },
@@ -107,17 +107,17 @@ def test_additional_groups_config(modify_root_config, caplog):
107107 assert ('additional_groups' in config ['directory_users' ] and
108108 len (config ['directory_users' ]['additional_groups' ]) == 2 )
109109
110- args = app . process_args ([ '-c' , root_config_file ] )
110+ args = cli_args ({ 'config_filename' : root_config_file } )
111111 options = ConfigLoader (args ).get_rule_options ()
112112 assert addl_groups [0 ]['source' ] in options ['additional_groups' ][0 ]['source' ].pattern
113113 assert addl_groups [1 ]['source' ] in options ['additional_groups' ][1 ]['source' ].pattern
114114
115115
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 ):
117117 (root_config_file , ldap_config_file , _ ) = tmp_config_files
118118 modify_ldap_config (['two_steps_lookup' ], {})
119119
120- args = app . process_args ([ '-c' , root_config_file ] )
120+ args = cli_args ({ 'config_filename' : root_config_file } )
121121
122122 # test invalid "two_steps_lookup" config
123123 with pytest .raises (AssertionException ):
@@ -138,9 +138,9 @@ def test_twostep_config(tmp_config_files, modify_ldap_config, caplog):
138138 assert options ['two_steps_lookup' ]['group_member_attribute_name' ] == 'member'
139139
140140
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 ):
142142 (root_config_file , _ , _ ) = tmp_config_files
143- args = app . process_args ([ '-c' , root_config_file ] )
143+ args = cli_args ({ 'config_filename' : root_config_file } )
144144
145145 # test default
146146 config_loader = ConfigLoader (args )
@@ -157,7 +157,7 @@ def test_adobe_users_config(tmp_config_files, modify_root_config):
157157
158158 # test command line param
159159 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' ]} )
161161 config_loader = ConfigLoader (args )
162162 options = config_loader .load_invocation_options ()
163163 assert 'adobe_users' in options
0 commit comments