From b522c72aaf8712562514bff239c1e32da9a65773 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 7 Aug 2024 13:29:51 +0000 Subject: [PATCH] test(jobs): clean jobs properly --- tests/test_graphql/test_jobs.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_graphql/test_jobs.py b/tests/test_graphql/test_jobs.py index 68a6d20..1f46981 100644 --- a/tests/test_graphql/test_jobs.py +++ b/tests/test_graphql/test_jobs.py @@ -1,14 +1,12 @@ -from tests.common import generate_jobs_query -import tests.test_graphql.test_api_backup +from selfprivacy_api.jobs import Jobs +from tests.common import generate_jobs_query from tests.test_graphql.common import ( - assert_ok, assert_empty, - assert_errorcode, get_data, ) +from tests.test_jobs import jobs -from selfprivacy_api.jobs import Jobs API_JOBS_QUERY = """ getJobs { @@ -42,17 +40,17 @@ def api_jobs(authorized_client): return result -def test_all_jobs_unauthorized(client): +def test_all_jobs_unauthorized(client, jobs): response = graphql_send_query(client, generate_jobs_query([API_JOBS_QUERY])) assert_empty(response) -def test_all_jobs_when_none(authorized_client): +def test_all_jobs_when_none(authorized_client, jobs): output = api_jobs(authorized_client) assert output == [] -def test_all_jobs_when_some(authorized_client): +def test_all_jobs_when_some(authorized_client, jobs): # We cannot make new jobs via API, at least directly job = Jobs.add("bogus", "bogus.bogus", "fungus") output = api_jobs(authorized_client)