mirror of
https://github.com/simonw/datasette.git
synced 2026-07-08 16:44:34 +02:00
Update tests from main for canonical error shape and rows key
Two tests merged from main were written against the pre-merge response shapes: the max_post_body_bytes 413 error now uses the canonical error envelope, and row update with return:true responds with a rows list rather than a singular row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GrHZSypDfMnym1tM5XJAFZ
This commit is contained in:
parent
194ee95ae2
commit
5c418efd7f
1 changed files with 7 additions and 5 deletions
|
|
@ -169,7 +169,10 @@ async def test_base64_write_api_insert_upsert_update_decode_blobs(ds_write):
|
|||
headers=_headers(token),
|
||||
)
|
||||
assert update_response.status_code == 200
|
||||
assert update_response.json()["row"]["data"] == {"$base64": True, "encoded": "/wAB"}
|
||||
assert update_response.json()["rows"][0]["data"] == {
|
||||
"$base64": True,
|
||||
"encoded": "/wAB",
|
||||
}
|
||||
|
||||
rows = (await db.execute("""
|
||||
select
|
||||
|
|
@ -344,10 +347,9 @@ async def test_insert_rows_post_body_too_large(tmp_path_factory):
|
|||
headers=_headers(token),
|
||||
)
|
||||
assert response.status_code == 413
|
||||
assert response.json() == {
|
||||
"ok": False,
|
||||
"errors": ["Request body exceeded maximum size of 100 bytes"],
|
||||
}
|
||||
assert response.json() == error_body(
|
||||
["Request body exceeded maximum size of 100 bytes"], 413
|
||||
)
|
||||
# A small body should still work
|
||||
response2 = await ds.client.post(
|
||||
"/data/docs/-/insert",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue