Example #1
0
def test_illegal_class_name():
    with pytest.raises(TaskNotFoundError, match=r'.*Illegal.*'):
        load_task_class('cowait.')

    with pytest.raises(TaskNotFoundError, match=r'.*Illegal.*'):
        load_task_class('.cowait')
Example #2
0
def test_multiple_defined_tasks():
    with pytest.raises(TaskNotFoundError, match=r'.*multiple*.'):
        load_task_class('cowait.test.utils.double_task_def')
Example #3
0
def test_task_module_not_found():
    with pytest.raises(TaskNotFoundError):
        load_task_class('cowait.worker.unknown_module')
Example #4
0
def test_no_defined_tasks():
    with pytest.raises(TaskNotFoundError, match=r'.*not contain any tasks.*'):
        load_task_class('cowait.worker.loader')
Example #5
0
def test_load_task_class():
    loaded = load_task_class('cowait.tasks.shell')
    assert loaded == ShellTask