Skip to content

Commit c427dd5

Browse files
author
Robin VAN DE MERGHEL
committed
test: Add a small test for jdl search
1 parent 94327c2 commit c427dd5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

diracx-routers/tests/jobs/test_status.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,21 @@ def test_insert_and_reschedule(normal_user_client: TestClient):
395395
}
396396

397397

398+
def test_insert_and_get_jdl(normal_user_client: TestClient):
399+
job_definitions = [TEST_JDL] * 10
400+
r = normal_user_client.post("/api/jobs/jdl", json=job_definitions)
401+
assert r.status_code == 200, r.json()
402+
assert len(r.json()) == len(job_definitions)
403+
404+
submitted_job_ids = set(job_dict["JobID"] for job_dict in r.json())
405+
406+
for id in submitted_job_ids:
407+
# Get the JDL
408+
r = normal_user_client.get(f"/api/jobs/{id}/jdl")
409+
assert r.status_code == 200, r.json()
410+
# Won't fetch it, submission logic alters the JDL
411+
412+
398413
# test edge case for rescheduling
399414

400415

0 commit comments

Comments
 (0)