File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,22 @@ def test_set_option_multiple(self):
195
195
assert cf .get_option ("b.c" ) is None
196
196
assert cf .get_option ("b.b" ) == 10.0
197
197
198
+ def test_set_option_dict (self ):
199
+ cf .register_option ("a" , 1 , "doc" )
200
+ cf .register_option ("b.c" , "hullo" , "doc2" )
201
+ cf .register_option ("b.b" , None , "doc2" )
202
+
203
+ assert cf .get_option ("a" ) == 1
204
+ assert cf .get_option ("b.c" ) == "hullo"
205
+ assert cf .get_option ("b.b" ) is None
206
+
207
+ options_dict = {"a" : "2" , "b.c" : None , "b.b" : 10.0 }
208
+ cf .set_option (** options_dict )
209
+
210
+ assert cf .get_option ("a" ) == "2"
211
+ assert cf .get_option ("b.c" ) is None
212
+ assert cf .get_option ("b.b" ) == 10.0
213
+
198
214
def test_validation (self ):
199
215
cf .register_option ("a" , 1 , "doc" , validator = cf .is_int )
200
216
cf .register_option ("d" , 1 , "doc" , validator = cf .is_nonnegative_int )
You can’t perform that action at this time.
0 commit comments