def __new__(cls, class_name, base_classes, dct): # new_class = super(class_creater, cls).__new__(cls, class_name, base_classes, {}) dct = {} if file_name is not None: with open(file_name, "r") as file: args = from_json(file.read()) for item in args.items(): key = item[0] value = item[1] dct[key] = value return super(class_creater, cls).__new__(cls, class_name, base_classes, dct)
def test_from_json(self): self.assertEqual(from_json(self.string_json_obj), self.obj) self.assertEquals(from_json(to_json(self.obj)), self.obj)