Skip to content
Snippets Groups Projects
Commit 515400cb authored by Thomas Kluyver's avatar Thomas Kluyver Committed by Philipp Schmidt
Browse files

Make monkeypatching of function temporary

parent 89f89c90
No related branches found
No related tags found
1 merge request!655Launch jobs with variable nice value
......@@ -144,13 +144,15 @@ async def test_wait_on_transfer_exceptions(
('sim', ['DARK', '1', '2', '3', '4'], 1, "success: simulated"),
],
)
async def test_run_action(mode, cmd, retcode, expected):
async def test_run_action(mode, cmd, retcode, expected, monkeypatch):
job_db = mock.Mock()
async def mock_run_proc_async(*args):
return retcode, b'Submitted job: 42'
webservice.webservice.run_proc_async = mock_run_proc_async
monkeypatch.setattr(
webservice.webservice, 'run_proc_async', mock_run_proc_async
)
ret = await run_action(job_db, cmd, mode, 1, 1, 1)
assert ret.lower().startswith(expected)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment