def print_obj(d, indent=0): for k, v in d.iteritems(): if utils.is_dict(v): print "{}{}: \n".format(' ' * indent, k), print_obj(v, indent + 1) elif utils.is_list(v): print "{}{}: ".format(' ' * indent, k) for a in v: print_obj(a, indent + 1) else: print "{}{}: {}".format(' ' * indent, k, v)
def test_is_not_dict(self): self.assertFalse(utils.is_dict([]))
def test_is_dict(self): self.assertTrue(utils.is_dict({}))