示例#1
0
 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
             }
         }
     }
示例#2
0
 def test_float(self):
     assert decode({"a": "1.2"}) == {"a": 1.2}
示例#3
0
 def test_int(self):
     assert decode({"a": "1"}) == {"a": 1}
示例#4
0
 def test_nested_once(self):
     assert decode({"a.b": "1", "a.c": "2"}) == {"a": {"b": 1, "c": 2}}
示例#5
0
 def test_list(self):
     assert decode({"a": "[1, 2, 3]"}) == {"a": [1, 2, 3]}
示例#6
0
 def test_false(self):
     assert decode({"a": "false"}) == {"a": False}
示例#7
0
 def test_true(self):
     assert decode({"a": "true"}) == {"a": True}
示例#8
0
 def test_none(self):
     assert decode({"a": "null"}) == {"a": None}
示例#9
0
 def test_str(self):
     assert decode({"a": '"b"'}) == {"a": "b"}