Fix missing context args to get_flow()

TaskExecutor._get_flow() passes a context argument to the task
initialization routine, but a couple of tests that short-circuit that
do not. This makes those tests mimic the real behavior separately
from the later patch that needs it to make it clear that it is not
actually requiring a new argument at runtime.

Related to blueprint glance-unified-quotas

Change-Id: Ifc2adcb7f8eaa7da2e7b063a8b79175025582500
This commit is contained in:
Dan Smith 2021-06-02 08:07:13 -07:00
parent a854fcfab8
commit 4f20e5007f
2 changed files with 3 additions and 1 deletions

View File

@ -569,6 +569,7 @@ class TestImportCopyImageTask(test_utils.BaseTestCase):
admin_repo=admin_repo, admin_repo=admin_repo,
image_id=IMAGE_ID1, image_id=IMAGE_ID1,
import_req=fake_req, import_req=fake_req,
context=self.context,
backend=['cheap']) backend=['cheap'])
# Assert that we saved the image with the admin repo instead of the # Assert that we saved the image with the admin repo instead of the

View File

@ -93,7 +93,8 @@ class TestImportTaskFlow(test_utils.BaseTestCase):
'task_repo': mock.MagicMock(), 'task_repo': mock.MagicMock(),
'image_repo': mock.MagicMock(), 'image_repo': mock.MagicMock(),
'image_id': mock.MagicMock(), 'image_id': mock.MagicMock(),
'import_req': import_req or mock.MagicMock() 'import_req': import_req or mock.MagicMock(),
'context': mock.MagicMock(),
} }
inputs['image_repo'].get.return_value = mock.MagicMock( inputs['image_repo'].get.return_value = mock.MagicMock(
extra_properties={'os_glance_import_task': mock.sentinel.task_id}) extra_properties={'os_glance_import_task': mock.sentinel.task_id})