From 7c1cd438a0a9fe5cababc9ff0164ce7844c98abf Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 23 Jun 2021 10:08:07 -0700 Subject: [PATCH] Fix broken test_update_queued_image_with_hidden This fixes the test to behave the way we expect. It was failing to do the update because it was using an image the requester did not own, and asserting the found behavior of 403. However, the intent here is to allow it to be updated. So, this uses the proper image and asserts the proper behavior. Change-Id: I71afe6a877485c8f92e67dcf32bb475c1a1a42a3 Closes-Bug: #1933360 --- glance/tests/unit/v2/test_images_resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glance/tests/unit/v2/test_images_resource.py b/glance/tests/unit/v2/test_images_resource.py index e7570d41f7..495b02fdd1 100644 --- a/glance/tests/unit/v2/test_images_resource.py +++ b/glance/tests/unit/v2/test_images_resource.py @@ -1256,8 +1256,8 @@ class TestImagesController(base.IsolatedUnitTest): def test_update_queued_image_with_hidden(self): request = unit_test_utils.get_fake_request() changes = [{'op': 'replace', 'path': ['os_hidden'], 'value': 'true'}] - self.assertRaises(webob.exc.HTTPForbidden, self.controller.update, - request, UUID3, changes=changes) + image = self.controller.update(request, UUID1, changes=changes) + self.assertTrue(image.os_hidden) def test_update_with_bad_min_disk(self): request = unit_test_utils.get_fake_request()