def test_nested_twice(self): assert decode({ "a.b1.c1": "3", "a.b1.d1": "4", "a.b2.c2": "5", "a.b2.d2": "6" }) == { "a": { "b1": { "c1": 3, "d1": 4 }, "b2": { "c2": 5, "d2": 6 } } }
def test_float(self): assert decode({"a": "1.2"}) == {"a": 1.2}
def test_int(self): assert decode({"a": "1"}) == {"a": 1}
def test_nested_once(self): assert decode({"a.b": "1", "a.c": "2"}) == {"a": {"b": 1, "c": 2}}
def test_list(self): assert decode({"a": "[1, 2, 3]"}) == {"a": [1, 2, 3]}
def test_false(self): assert decode({"a": "false"}) == {"a": False}
def test_true(self): assert decode({"a": "true"}) == {"a": True}
def test_none(self): assert decode({"a": "null"}) == {"a": None}
def test_str(self): assert decode({"a": '"b"'}) == {"a": "b"}