mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
17ec309e14
commit
2ce7872e3b
2 changed files with 25 additions and 0 deletions
|
|
@ -283,6 +283,30 @@ def test_serve_create(tmpdir):
|
|||
assert db_path.exists()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("argument", ("-c", "--config"))
|
||||
@pytest.mark.parametrize("format_", ("json", "yaml"))
|
||||
def test_serve_config(tmpdir, argument, format_):
|
||||
config_path = tmpdir / "datasette.{}".format(format_)
|
||||
config_path.write_text(
|
||||
"settings:\n default_page_size: 5\n"
|
||||
if format_ == "yaml"
|
||||
else '{"settings": {"default_page_size": 5}}',
|
||||
"utf-8",
|
||||
)
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
[
|
||||
argument,
|
||||
str(config_path),
|
||||
"--get",
|
||||
"/-/settings.json",
|
||||
],
|
||||
)
|
||||
assert result.exit_code == 0, result.output
|
||||
assert json.loads(result.output)["default_page_size"] == 5
|
||||
|
||||
|
||||
def test_serve_duplicate_database_names(tmpdir):
|
||||
"'datasette db.db nested/db.db' should attach two databases, /db and /db_2"
|
||||
runner = CliRunner()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue