示例#1
0
def test_configure_task_known(app):
    @app.task(name="foobar", queue="marsupilami")
    def mytask():
        pass

    job = cli.configure_task(app, "foobar", {}, allow_unknown=False).job
    assert job.task_name == "foobar"
    assert job.queue == "marsupilami"
示例#2
0
def test_test_configure_task_error(app):
    with pytest.raises(exceptions.TaskNotFound):
        assert cli.configure_task(app, "foobar", {}, allow_unknown=False)
示例#3
0
def test_configure_task_unknown(app):
    job = cli.configure_task(app, "foobar", {}, allow_unknown=True).job
    assert job.task_name == "foobar"
    assert job.queue == "default"