def test_task_redo2(): """Test that `.redo()` raises if called on a Task that is not TERMINATED.""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # cannot redo a task that is not yet terminated task.redo()
def test_task_progress(): with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # run until terminated while task.execution.state != Run.State.TERMINATED: task.progress() assert task.execution.state == Run.State.TERMINATED
def test_task_progress(): with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # run until terminated while task.execution.state != Run.State.TERMINATED: task.progress() assert task.execution.state == Run.State.TERMINATED
def test_task_redo2(): """Test that `.redo()` raises if called on a Task that is not TERMINATED.""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # cannot redo a task that is not yet terminated with pytest.raises(AssertionError): task.redo() pytest.fail("`Task.redo()` succeeded on task not yet finished")
def test_task_redo2(): """Test that `.redo()` raises if called on a Task that is not TERMINATED.""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # cannot redo a task that is not yet terminated with pytest.raises(AssertionError, message="`Task.redo()` succeeded on task not yet finished"): task.redo()
def test_task_redo1(): """Test correct use of `Task.redo()`""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # run until terminated while task.execution.state != Run.State.TERMINATED: task.progress() assert task.execution.state == Run.State.TERMINATED # no do it all over again task.redo() assert task.execution.state == Run.State.NEW task.progress() assert task.execution.state != Run.State.NEW assert task.execution.state in [Run.State.SUBMITTED, Run.State.RUNNING]
def test_task_redo1(): """Test correct use of `Task.redo()`""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.submit() assert task.execution.state == Run.State.SUBMITTED # run until terminated while task.execution.state != Run.State.TERMINATED: task.progress() assert task.execution.state == Run.State.TERMINATED # no do it all over again task.redo() assert task.execution.state == Run.State.NEW task.progress() assert task.execution.state != Run.State.NEW assert task.execution.state in [Run.State.SUBMITTED, Run.State.RUNNING]
def test_task_redo3(): """Test that `.redo()` is a no-op if the Task is still NEW.""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.redo()
def test_task_redo3(): """Test that `.redo()` is a no-op if the Task is still NEW.""" with temporary_core() as core: task = SuccessfulApp() task.attach(core) task.redo()