def test_instance_create_error_extra_attribute_json(self): modified_dict = self.instance_create_error_dict.copy() modified_dict['test_dummy'] = 'test_dummy' actual_json = json.dumps(modified_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertIsNone(actual_obj)
def test_instance_create_error_missing_attribute_json(self): modified_dict = self.instance_create_error_dict.copy() modified_dict.popitem() actual_json = json.dumps(modified_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertIsNone(actual_obj)
def test_instance_create_error_extra_attribute_json(self): modified_dict = self.instance_create_error_dict.copy() modified_dict['test_dummy'] = 'test_dummy' actual_json = json.dumps(modified_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertIsNone(actual_obj)
def test_instance_create_error_missing_attribute_json(self): modified_dict = self.instance_create_error_dict.copy() modified_dict.popitem() actual_json = json.dumps(modified_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertIsNone(actual_obj)
def test_instance_create_error_valid_json(self): expected_obj = self.instance_create_error_obj actual_json = json.dumps(self.instance_create_error_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertEqual(expected_obj, actual_obj) self.assertFalse(actual_obj.is_empty())
def test_instance_create_error_valid_json(self): expected_obj = self.instance_create_error_obj actual_json = json.dumps(self.instance_create_error_dict) actual_obj = InstanceCreateError.deserialize(actual_json, 'json') self.assertEqual(expected_obj, actual_obj) self.assertFalse(actual_obj.is_empty())