windows env vars are uppercase

This commit is contained in:
David Lord 2022-03-25 12:05:07 -07:00
parent 4eb5e9455b
commit e75d575361
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
2 changed files with 24 additions and 9 deletions

View file

@ -79,12 +79,24 @@ def test_from_prefixed_env_nested(monkeypatch):
app.config["EXIST"] = {"ok": "value", "flag": True, "inner": {"ik": 1}}
app.config.from_prefixed_env()
assert app.config["EXIST"] == {
"ok": "other",
"flag": True,
"inner": {"ik": 2},
"new": {"more": {"k": False}},
}
if os.name != "nt":
assert app.config["EXIST"] == {
"ok": "other",
"flag": True,
"inner": {"ik": 2},
"new": {"more": {"k": False}},
}
else:
# Windows env var keys are always uppercase.
assert app.config["EXIST"] == {
"ok": "value",
"OK": "other",
"flag": True,
"inner": {"ik": 1},
"INNER": {"IK": 2},
"NEW": {"MORE": {"k": False}},
}
assert app.config["NEW"] == {"K": "v"}