Skip to content

Commit 5e2146b

Browse files
committed
fix test for dictionary input
1 parent 698fd61 commit 5e2146b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/config/test_config.py

+16
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,22 @@ def test_set_option_multiple(self):
195195
assert cf.get_option("b.c") is None
196196
assert cf.get_option("b.b") == 10.0
197197

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+
198214
def test_validation(self):
199215
cf.register_option("a", 1, "doc", validator=cf.is_int)
200216
cf.register_option("d", 1, "doc", validator=cf.is_nonnegative_int)

0 commit comments

Comments
 (0)