Esempio n. 1
0
    def test_instance_update_extra_attribute_json(self):
        """Verify event with unexpected attribute does not deserialize"""
        modified_dict = self.instance_update_dict.copy()
        modified_dict['test_dummy'] = 'test_dummy'

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')
        self.assertIsNone(actual_obj)
Esempio n. 2
0
    def test_instance_update_missing_attribute_json(self):
        """Verify event missing expected attribute does not deserialize"""
        modified_dict = self.instance_update_dict.copy()
        modified_dict.popitem()

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')
        self.assertIsNone(actual_obj)
    def test_instance_update_extra_attribute_json(self):
        """Verify event with unexpected attribute does not deserialize"""
        modified_dict = self.instance_update_dict.copy()
        modified_dict['test_dummy'] = 'test_dummy'

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')
        self.assertIsNone(actual_obj)
    def test_instance_update_missing_attribute_json(self):
        """Verify event missing expected attribute does not deserialize"""
        modified_dict = self.instance_update_dict.copy()
        modified_dict.popitem()

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')
        self.assertIsNone(actual_obj)
Esempio n. 5
0
    def test_instance_update_valid_json(self):
        """Verify that the valid event deserialized correctly"""
        expected_obj = self.instance_update_obj

        actual_json = json.dumps(self.instance_update_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')

        self.assertEqual(expected_obj, actual_obj)
        self.assertFalse(actual_obj.is_empty())
    def test_instance_update_valid_json(self):
        """Verify that the valid event deserialized correctly"""
        expected_obj = self.instance_update_obj

        actual_json = json.dumps(self.instance_update_dict)
        actual_obj = InstanceUpdate.deserialize(actual_json, 'json')

        self.assertEqual(expected_obj, actual_obj)
        self.assertFalse(actual_obj.is_empty())