mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
"$env": "X" mechanism now works with nested lists, closes #837
This commit is contained in:
parent
f39f111331
commit
fba8ff6e76
6 changed files with 48 additions and 12 deletions
|
|
@ -503,3 +503,17 @@ def test_multi_params(data, should_raise):
|
|||
)
|
||||
def test_actor_matches_allow(actor, allow, expected):
|
||||
assert expected == utils.actor_matches_allow(actor, allow)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"config,expected",
|
||||
[
|
||||
({"foo": "bar"}, {"foo": "bar"}),
|
||||
({"$env": "FOO"}, "x"),
|
||||
({"k": {"$env": "FOO"}}, {"k": "x"}),
|
||||
([{"k": {"$env": "FOO"}}, {"z": {"$env": "FOO"}}], [{"k": "x"}, {"z": "x"}]),
|
||||
({"k": [{"in_a_list": {"$env": "FOO"}}]}, {"k": [{"in_a_list": "x"}]}),
|
||||
],
|
||||
)
|
||||
def test_resolve_env_secrets(config, expected):
|
||||
assert expected == utils.resolve_env_secrets(config, {"FOO": "x"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue