mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-05 10:49:52 +08:00
test(notebook): simplify the non-finite verdict PATCH body
Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
This commit is contained in:
@@ -651,14 +651,11 @@ def test_entry_patch_rejects_non_finite_verdict_numbers(bank):
|
||||
store, _, client = bank
|
||||
entry = seed(store)
|
||||
# ``json.loads`` accepts these literals; stored, they would break every read.
|
||||
body = '{"ai_verdict": {"result": "correct", "final": true, "awarded_points": N}}'
|
||||
for literal in ("Infinity", "NaN", "1e999"):
|
||||
body = (
|
||||
'{"ai_verdict": {"result": "correct", "final": true, '
|
||||
f'"awarded_points": {literal}}}}}'
|
||||
)
|
||||
response = client.patch(
|
||||
f"/bank/entries/{entry['id']}",
|
||||
content=body,
|
||||
content=body.replace("N", literal),
|
||||
headers={"content-type": "application/json"},
|
||||
)
|
||||
assert response.status_code == 422
|
||||
|
||||
Reference in New Issue
Block a user