Browse Source

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
changes/46/794246/3
Dan Smith 2 weeks ago
parent
commit
4f20e5007f
2 changed files with 3 additions and 1 deletions
  1. +1
    -0
      glance/tests/unit/async_/flows/test_api_image_import.py
  2. +2
    -1
      glance/tests/unit/async_/test_async.py

+ 1
- 0
glance/tests/unit/async_/flows/test_api_image_import.py View File

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


+ 2
- 1
glance/tests/unit/async_/test_async.py View File

@ -93,7 +93,8 @@ class TestImportTaskFlow(test_utils.BaseTestCase):
'task_repo': mock.MagicMock(),
'image_repo': 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(
extra_properties={'os_glance_import_task': mock.sentinel.task_id})


Loading…
Cancel
Save