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 committed Oct 16, 2020
1 parent 18b2e3d commit 333b64a
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 333b64a

Please sign in to comment.