mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette --get --headers option, closes #2578
This commit is contained in:
parent
9f74dc22a8
commit
ce464da34b
3 changed files with 23 additions and 1 deletions
|
|
@ -52,6 +52,27 @@ def test_serve_with_get(tmp_path_factory):
|
|||
pm.unregister(to_unregister)
|
||||
|
||||
|
||||
def test_serve_with_get_headers():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
[
|
||||
"serve",
|
||||
"--memory",
|
||||
"--get",
|
||||
"/_memory/",
|
||||
"--headers",
|
||||
],
|
||||
)
|
||||
# exit_code is 1 because it wasn't a 200 response
|
||||
assert result.exit_code == 1, result.output
|
||||
assert result.output == (
|
||||
"HTTP/1.1 302\n"
|
||||
"location: /_memory\n"
|
||||
"content-type: text/html; charset=utf-8\n"
|
||||
)
|
||||
|
||||
|
||||
def test_serve_with_get_and_token():
|
||||
runner = CliRunner()
|
||||
result1 = runner.invoke(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue