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.Load(path) t1.output.keep() s.submit() assert t1.output.fetch().get_bytes() == content
def test_task_open_not_exists(test_env): test_env.start(1) with test_env.client.new_session() as s: t1 = tasks.Load("/not/exists") s.submit() pytest.raises(TaskException, lambda: t1.wait())
def test_task_open_not_absolute(test_env): test_env.start(1) with test_env.client.new_session() as s: t1 = tasks.Load("not/absolute/path") s.submit() pytest.raises(TaskException, lambda: t1.wait())