def test_dict_contains_list_of_dicts(self): d = dict(a=[dict(b=2), dict(c=3)]) m = dhcp_agent.DictModel(d) self.assertEqual(m.a[0].b, 2) self.assertEqual(m.a[1].c, 3)
def test_dict_has_sub_dict(self): d = dict(a=dict(b=2)) m = dhcp_agent.DictModel(d) self.assertEqual(m.a.b, 2)
def test_dict_contains_list(self): d = dict(a=[1, 2]) m = dhcp_agent.DictModel(d) self.assertEqual(m.a, [1, 2])
def test_basic_dict(self): d = dict(a=1, b=2) m = dhcp_agent.DictModel(d) self.assertEqual(m.a, 1) self.assertEqual(m.b, 2)