mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette.client internal requests mechanism
Closes #943 * Datasette now requires httpx>=0.15 * Support OPTIONS without 500, closes #1001 * Added internals tests for datasette.client methods * Datasette's own test mechanism now uses httpx to simulate requests * Tests simulate HTTP 1.1 now * Added base_url in a bunch more places * Mark some tests as xfail - will remove that when new httpx release ships: #1005
This commit is contained in:
parent
7249ac5ca0
commit
8f97b9b58e
18 changed files with 163 additions and 100 deletions
|
|
@ -380,9 +380,7 @@ def view_names_client(tmp_path_factory):
|
|||
conn = sqlite3.connect(db_path)
|
||||
conn.executescript(TABLES)
|
||||
return _TestClient(
|
||||
Datasette(
|
||||
[db_path], template_dir=str(templates), plugins_dir=str(plugins)
|
||||
).app()
|
||||
Datasette([db_path], template_dir=str(templates), plugins_dir=str(plugins))
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -748,7 +746,7 @@ def test_hook_register_magic_parameters(restore_working_directory):
|
|||
response = client.post("/data/runme", {}, csrftoken_from=True)
|
||||
assert 200 == response.status
|
||||
actual = client.get("/data/logs.json?_sort_desc=rowid&_shape=array").json
|
||||
assert [{"rowid": 1, "line": "1.0"}] == actual
|
||||
assert [{"rowid": 1, "line": "1.1"}] == actual
|
||||
# Now try the GET request against get_uuid
|
||||
response_get = client.get("/data/get_uuid.json?_shape=array")
|
||||
assert 200 == response_get.status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue