mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Smarter merging of metadata and extra_metadata, closes #724
This commit is contained in:
parent
d55fe8cdfc
commit
d349d57cdf
3 changed files with 21 additions and 6 deletions
|
|
@ -1,8 +1,9 @@
|
|||
from click.testing import CliRunner
|
||||
from datasette import cli
|
||||
from unittest import mock
|
||||
import pytest
|
||||
import json
|
||||
import pytest
|
||||
import textwrap
|
||||
|
||||
|
||||
@mock.patch("shutil.which")
|
||||
|
|
@ -146,7 +147,16 @@ def test_publish_cloudrun_plugin_secrets(mock_call, mock_output, mock_which):
|
|||
runner = CliRunner()
|
||||
with runner.isolated_filesystem():
|
||||
open("test.db", "w").write("data")
|
||||
open("metadata.yml", "w").write("title: Hello from metadata YAML")
|
||||
open("metadata.yml", "w").write(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
title: Hello from metadata YAML
|
||||
plugins:
|
||||
datasette-auth-github:
|
||||
foo: bar
|
||||
"""
|
||||
).strip()
|
||||
)
|
||||
result = runner.invoke(
|
||||
cli.cli,
|
||||
[
|
||||
|
|
@ -189,7 +199,8 @@ CMD datasette serve --host 0.0.0.0 -i test.db --cors --inspect-file inspect-data
|
|||
"title": "Hello from metadata YAML",
|
||||
"plugins": {
|
||||
"datasette-auth-github": {
|
||||
"client_id": {"$env": "DATASETTE_AUTH_GITHUB_CLIENT_ID"}
|
||||
"foo": "bar",
|
||||
"client_id": {"$env": "DATASETTE_AUTH_GITHUB_CLIENT_ID"},
|
||||
}
|
||||
},
|
||||
} == json.loads(metadata)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue