mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Move Metadata to --internal database
Refs: - https://github.com/simonw/datasette/pull/2343 - https://github.com/simonw/datasette/issues/2341
This commit is contained in:
parent
8f9509f00c
commit
e1bfab3fca
22 changed files with 286 additions and 214 deletions
|
|
@ -99,12 +99,6 @@ def config_dir_client(config_dir):
|
|||
yield _TestClient(ds)
|
||||
|
||||
|
||||
def test_metadata(config_dir_client):
|
||||
response = config_dir_client.get("/-/metadata.json")
|
||||
assert 200 == response.status
|
||||
assert METADATA == response.json
|
||||
|
||||
|
||||
def test_settings(config_dir_client):
|
||||
response = config_dir_client.get("/-/settings.json")
|
||||
assert 200 == response.status
|
||||
|
|
@ -149,17 +143,6 @@ def test_databases(config_dir_client):
|
|||
assert db["is_mutable"] == (expected_name != "immutable")
|
||||
|
||||
|
||||
@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)
|
||||
response = client.get("/-/metadata.json")
|
||||
assert 200 == response.status
|
||||
assert {"title": "Title from metadata"} == response.json
|
||||
|
||||
|
||||
def test_store_config_dir(config_dir_client):
|
||||
ds = config_dir_client.ds
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue