Skip to content

Commit

Permalink
Mock cannot be used with await, so provide a fake coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow authored and dwsutherland committed Oct 29, 2020
1 parent d3648e7 commit 338b973
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cylc/uiserver/tests/test_workflows_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,13 @@ async def test_connect(
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.get_header')
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.'
'start_subscription')
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.sync_workflow')

async def my_sync_workflow(*args, **kwargs):
return True
mocker.patch(
'cylc.uiserver.data_store_mgr.DataStoreMgr.sync_workflow',
side_effect=my_sync_workflow
)

await uiserver.workflows_mgr.update()

Expand Down

0 comments on commit 338b973

Please sign in to comment.