Partial json_renderer refactor, part of #2136

This commit is contained in:
Simon Willison 2023-08-09 11:52:51 -07:00
commit f3944608cc
5 changed files with 85 additions and 74 deletions

View file

@ -35,10 +35,10 @@ def test_serve_with_get(tmp_path_factory):
],
)
assert 0 == result.exit_code, result.output
assert {
"truncated": False,
"columns": ["sqlite_version()"],
}.items() <= json.loads(result.output).items()
data = json.loads(result.output)
# Should have a single row with a single column
assert len(data["rows"]) == 1
assert list(data["rows"][0].keys()) == ["sqlite_version()"]
# The plugin should have created hello.txt
assert (plugins_dir / "hello.txt").read_text() == "hello"