'Ensure that image properties can be removed.
Image properties should be able to be added and removed simultaneously
as long as the image has fewer than the limited number of image
properties after the transaction.'

def test_update_add_and_remove_property_under_limit(self):

    request = unit_test_utils.get_fake_request()
    changes = [{'op': 'add', 'path': ['foo'], 'value': 'baz'}, {'op': 'add', 'path': ['snitch'], 'value': 'golden'}]
    self.controller.update(request, UUID1, changes)
    self.config(image_property_quota=1)
    changes = [{'op': 'remove', 'path': ['foo']}, {'op': 'remove', 'path': ['snitch']}, {'op': 'add', 'path': ['fizz'], 'value': 'buzz'}]
    output = self.controller.update(request, UUID1, changes)
    self.assertEqual(UUID1, output.image_id)
    self.assertEqual(1, len(output.extra_properties))
    self.assertEqual('buzz', output.extra_properties['fizz'])
    self.assertNotEqual(output.created_at, output.updated_at)
