Skip to content

Commit 7066ccb

Browse files
committed
Slightly better test for nested dictionary support.
1 parent eb56762 commit 7066ccb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_toml_parser/test_parse_file.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ def test_env(tmp_path, monkeypatch):
197197

198198

199199
def test_env_in_nested_dict(tmp_path, monkeypatch):
200-
monkeypatch.setenv("SOME_VAR", "blob")
200+
monkeypatch.setenv("DATABASE_ENGINE", "django.db.backends.sqlite3")
201201

202-
expected = {"SOMETHING": {"MORE": "blob"}}
202+
expected = {"DATABASES": {"default": {"ENGINE": "django.db.backends.sqlite3"}}}
203203

204204
path = tmp_path / "pyproject.toml"
205205
path.write_text("""
206-
[tool.django]
207-
SOMETHING = { MORE = { "$env" = "SOME_VAR" } }
206+
[tool.django.DATABASES]
207+
default = { ENGINE = { "$env" = "DATABASE_ENGINE", "$default" = "django.db.backends.postgresql" } }
208208
""")
209209

210210
actual = Parser(path).parse_file()

0 commit comments

Comments
 (0)