mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Directory configuration mode supports metadata.yaml, closes #747
This commit is contained in:
parent
d18086ae01
commit
1d91ab71d4
2 changed files with 23 additions and 2 deletions
|
|
@ -130,3 +130,15 @@ def test_databases(config_dir_client):
|
|||
assert databases[0]["is_mutable"]
|
||||
assert "immutable" == databases[1]["name"]
|
||||
assert not databases[1]["is_mutable"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filename", ("metadata.yml", "metadata.yaml"))
|
||||
def test_metadata_yaml(tmp_path_factory, filename):
|
||||
config_dir = tmp_path_factory.mktemp("yaml-config-dir")
|
||||
(config_dir / filename).write_text("title: Title from metadata", "utf-8")
|
||||
ds = Datasette([], config_dir=config_dir)
|
||||
client = TestClient(ds.app())
|
||||
client.ds = ds
|
||||
response = client.get("/-/metadata.json")
|
||||
assert 200 == response.status
|
||||
assert {"title": "Title from metadata"} == json.loads(response.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue