示例#1
0
    def test_instance_resize_confirm_end_extra_attribute_json(self):
        """Verify event with unexpected attribute does not deserialize"""
        modified_dict = self.resize_confirm_end_dict.copy()
        modified_dict['test_dummy'] = 'test_dummy'

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceResizeConfirmEnd.deserialize(actual_json, 'json')
        self.assertIsNone(actual_obj)
示例#2
0
    def test_instance_resize_confirm_end_missing_attribute_json(self):
        """Verify event missing expected attribute does not deserialize"""
        modified_dict = self.resize_confirm_end_dict.copy()
        modified_dict.popitem()

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

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

        actual_json = json.dumps(modified_dict)
        actual_obj = InstanceResizeConfirmEnd.deserialize(
            actual_json, 'json')
        self.assertIsNone(actual_obj)
示例#5
0
    def test_instance_resize_confirm_end_valid_json(self):
        """Verify that the valid event deserialized correctly"""
        expected_obj = self.resize_confirm_end_obj

        actual_json = json.dumps(self.resize_confirm_end_dict)
        actual_obj = InstanceResizeConfirmEnd.deserialize(actual_json, 'json')

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

        actual_json = json.dumps(self.resize_confirm_end_dict)
        actual_obj = InstanceResizeConfirmEnd.deserialize(
            actual_json, 'json')

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