swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fadd7cea0b8>
storage = <swh.storage.in_memory.InMemoryStorage object at 0x7fadd7cea630>
def test_cli_task_runner_unknown_task_types(swh_scheduler, storage):
"""When passing at least one unknown task type, the runner should fail."""
task_types = swh_scheduler.get_task_types()
task_type_names = [t["type"] for t in task_types]
known_task_type = random.choice(task_type_names)
unknown_task_type = "unknown-task-type"
assert unknown_task_type not in task_type_names
with pytest.raises(ValueError, match="Unknown"):
invoke(
swh_scheduler,
False,
[
"start-runner",
"--task-type",
known_task_type,
"--task-type",
> unknown_task_type,
],
)
E Failed: DID NOT RAISE <class 'ValueError'>
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_cli.py:817: Failed
TEST RESULT
TEST RESULT
- Run At
- Aug 13 2021, 2:57 PM