Пример #1
0
def test_task_open_ok(test_env):
    import os.path
    path = os.path.abspath(__file__)
    with open(path, "rb") as f:
        content = f.read()
    test_env.start(1)
    with test_env.client.new_session() as s:
        t1 = tasks.open(path)
        t1.output.keep()
        s.submit()
        assert t1.output.fetch().get_bytes() == content
Пример #2
0
def test_task_open_not_exists(test_env):
    test_env.start(1)
    with test_env.client.new_session() as s:
        t1 = tasks.open("/not/exists")
        s.submit()
        pytest.raises(RainException, lambda: t1.wait())
Пример #3
0
def test_task_open_not_absolute(test_env):
    test_env.start(1)
    with test_env.client.new_session() as s:
        t1 = tasks.open("not/absolute/path")
        s.submit()
        pytest.raises(RainException, lambda: t1.wait())