Fix failing copy_image flow init

The new networkx requirement apparently causes us to fail the
test_init_copy_flow_as_non_owner test because a None value can not be
added to the flow graph. This just mocks out the glance_store call
that is failing to get the staging store to avoid us choking there
so we can proceed. We are just testing get_flow so we never use it
anyway.

Closes-Bug: #1959361

Change-Id: I6fcb14ad240105ed0b1b9086c6c6c95034b4dd42
(cherry picked from commit ded8ecf382)
This commit is contained in:
Dan Smith 2021-08-04 08:18:55 -07:00 committed by Cyril Roelandt
parent fdf7b80daf
commit b1d635c287
1 changed files with 2 additions and 1 deletions

View File

@ -549,7 +549,8 @@ class TestImportCopyImageTask(test_utils.BaseTestCase):
overwrite=False)
@mock.patch("glance.async_.flows.api_image_import.image_import")
def test_init_copy_flow_as_non_owner(self, mock_import):
@mock.patch('glance_store.get_store_from_store_identifier')
def test_init_copy_flow_as_non_owner(self, mock_gs, mock_import):
img_repo = mock.MagicMock()
admin_repo = mock.MagicMock()