예제 #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')
예제 #2
0
def test_multiple_defined_tasks():
    with pytest.raises(TaskNotFoundError, match=r'.*multiple*.'):
        load_task_class('cowait.test.utils.double_task_def')
예제 #3
0
def test_task_module_not_found():
    with pytest.raises(TaskNotFoundError):
        load_task_class('cowait.worker.unknown_module')
예제 #4
0
def test_no_defined_tasks():
    with pytest.raises(TaskNotFoundError, match=r'.*not contain any tasks.*'):
        load_task_class('cowait.worker.loader')
예제 #5
0
def test_load_task_class():
    loaded = load_task_class('cowait.tasks.shell')
    assert loaded == ShellTask