Пример #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"}