def test_application_todict_dict_with_obj(self): MyObject = namedtuple('MyObject', 'a b') mo = MyObject('x', 'y') the_input = {'a': mo} actual = Application.todict(the_input) expected = {'a': {'a': 'x', 'b': 'y'}} self.assertEqual(actual, expected)
def test_application_todict_list(self): the_input = [{'a': 'b'}] actual = Application.todict(the_input) expected = [{'a': 'b'}] self.assertEqual(actual, expected)
def test_application_todict_dict(self): the_input = {'a': 'b'} actual = Application.todict(the_input) expected = {'a': 'b'} self.assertEqual(actual, expected)
def test_application_todict_none(self): the_input = None actual = Application.todict(the_input) expected = None self.assertEqual(actual, expected)