From 870d2c408de938e1b35fa215ccf683e09716126d Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 30 Nov 2022 15:37:59 +0000 Subject: [PATCH] jobs: test nofail at nonexistent update --- tests/test_jobs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_jobs.py b/tests/test_jobs.py index df5c952..7ef9a9b 100644 --- a/tests/test_jobs.py +++ b/tests/test_jobs.py @@ -20,6 +20,16 @@ def test_minimal_update(jobs_with_one_job): assert jobs.get_jobs() == [test_job] +def test_remove_update_nonexistent(jobs_with_one_job): + test_job = jobs_with_one_job.get_jobs()[0] + + jobs_with_one_job.remove(test_job) + assert jobs_with_one_job.get_jobs() == [] + + result = jobs_with_one_job.update(job=test_job, status=JobStatus.ERROR) + assert result == test_job # even though we might consider changing this behavior + + def test_jobs(jobs_with_one_job): jobs = jobs_with_one_job test_job = jobs_with_one_job.get_jobs()[0]