kopia lustrzana https://github.com/simonw/datasette
Test for --get --actor, refs #2153
rodzic
d8351b08ed
commit
2e2825869f
|
@ -80,7 +80,7 @@ def test_serve_with_get_and_token():
|
||||||
assert json.loads(result2.output) == {"actor": {"id": "root", "token": "dstok"}}
|
assert json.loads(result2.output) == {"actor": {"id": "root", "token": "dstok"}}
|
||||||
|
|
||||||
|
|
||||||
def test_serve_with_get_exit_code_for_error(tmp_path_factory):
|
def test_serve_with_get_exit_code_for_error():
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
result = runner.invoke(
|
result = runner.invoke(
|
||||||
cli,
|
cli,
|
||||||
|
@ -94,3 +94,26 @@ def test_serve_with_get_exit_code_for_error(tmp_path_factory):
|
||||||
)
|
)
|
||||||
assert result.exit_code == 1
|
assert result.exit_code == 1
|
||||||
assert "404" in result.output
|
assert "404" in result.output
|
||||||
|
|
||||||
|
|
||||||
|
def test_serve_get_actor():
|
||||||
|
runner = CliRunner()
|
||||||
|
result = runner.invoke(
|
||||||
|
cli,
|
||||||
|
[
|
||||||
|
"serve",
|
||||||
|
"--memory",
|
||||||
|
"--get",
|
||||||
|
"/-/actor.json",
|
||||||
|
"--actor",
|
||||||
|
'{"id": "root", "extra": "x"}',
|
||||||
|
],
|
||||||
|
catch_exceptions=False,
|
||||||
|
)
|
||||||
|
assert result.exit_code == 0
|
||||||
|
assert json.loads(result.output) == {
|
||||||
|
"actor": {
|
||||||
|
"id": "root",
|
||||||
|
"extra": "x",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue