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

def test_update_remove_property_while_over_limit(self):

    request = unit_test_utils.get_fake_request()
    changes = [{'op': 'add', 'path': ['foo'], 'value': 'baz'}, {'op': 'add', 'path': ['snitch'], 'value': 'golden'}, {'op': 'add', 'path': ['fizz'], 'value': 'buzz'}]
    self.controller.update(request, UUID1, changes)
    self.config(image_property_quota=1)
    changes = [{'op': 'remove', 'path': ['foo']}, {'op': 'remove', 'path': ['snitch']}]
    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)
