def test_complex_nested_structure(self): prop = Json() prop.a = [(Json(), 2), [[]], [1, (2, 3), 0]] self.assertDictEqual(prop, {'a': [( {}, 2, ), [[]], [1, (2, 3), 0]]})
def test_update_with_lists(self): org = Json() org.a = [1, 2, {'a': 'superman'}] someother = Json() someother.b = [{'b': 123}] org.update(someother) correct = {'a': [1, 2, {'a': 'superman'}], 'b': [{'b': 123}]} org.update(someother) self.assertDictEqual(org, correct) self.assertIsInstance(org.b[0], Json)
def test_update_with_lists(self): org = Json() org.a = [1, 2, {'a': 'superman'}] someother = Json() someother.b = [{'b': 123}] org.update(someother) correct = {'a': [1, 2, {'a': 'superman'}], 'b': [{'b': 123}]} org.update(someother) self.assertDictEqual(org, correct) self.assertIsInstance(org.b[0], Json)
def test_complex_nested_structure(self): prop = Json() prop.a = [(Json(), 2), [[]], [1, (2, 3), 0]] self.assertDictEqual(prop, {'a': [({}, 2,), [[]], [1, (2, 3), 0]]})
def test_set_one_level_property(self): prop = Json() prop.a = TEST_VAL self.assertDictEqual(prop, {'a': TEST_VAL})
def test_set_one_level_property(self): prop = Json() prop.a = TEST_VAL self.assertDictEqual(prop, {'a': TEST_VAL})