Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuwd committed Feb 10, 2025
1 parent d7356af commit 328cf93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
1 change: 0 additions & 1 deletion diracx-routers/src/diracx/routers/jobs/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,3 @@ async def patch_metadata(
int(job_id),
p_updates_,
)

21 changes: 10 additions & 11 deletions diracx-routers/tests/test_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,25 +1602,24 @@ def test_patch_metadata(normal_user_client: TestClient, valid_job_id: int):
assert j["MinorStatus"] == "Job accepted"
assert j["ApplicationStatus"] == "Unknown"


before = r.json()

# Act
hbt = str(datetime.now(timezone.utc))
r = normal_user_client.patch(
"/api/jobs/metadata",
json={
valid_job_id: {
"UserPriority": 2,
"HeartBeatTime": hbt,
# set a parameter
"JobType": "VerySpecialIndeed",
"UserPriority": 2,
"HeartBeatTime": hbt,
# set a parameter
"JobType": "VerySpecialIndeed",
}
},
)

# Assert
assert r.status_code == 204, "PATCH metadata should return 204 No Content on success"
assert (
r.status_code == 204
), "PATCH metadata should return 204 No Content on success"
r = normal_user_client.post(
"/api/jobs/search",
json={
Expand All @@ -1636,9 +1635,9 @@ def test_patch_metadata(normal_user_client: TestClient, valid_job_id: int):
)
assert r.status_code == 200, r.json()

after =r.json()

assert r.json()[0]["JobID"] == valid_job_id
assert r.json()[0]["JobType"] == "VerySpecialIndeed"
assert datetime.fromisoformat(r.json()[0]["HeartBeatTime"]) == datetime.fromisoformat(hbt)
assert datetime.fromisoformat(
r.json()[0]["HeartBeatTime"]
) == datetime.fromisoformat(hbt)
assert r.json()[0]["UserPriority"] == 2

0 comments on commit 328cf93

Please sign in to comment.