Skip to content

Commit

Permalink
Test for --get --actor, refs #2153
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 28, 2023
1 parent d8351b0 commit 2e28258
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/test_cli_serve_get.py
Expand Up @@ -80,7 +80,7 @@ def test_serve_with_get_and_token():
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()
result = runner.invoke(
cli,
Expand All @@ -94,3 +94,26 @@ def test_serve_with_get_exit_code_for_error(tmp_path_factory):
)
assert result.exit_code == 1
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",
}
}

0 comments on commit 2e28258

Please sign in to comment.