Files
wehub-resource-sync 2860fb5d18
Security / Dependency review (push) Has been skipped
Scorecard / Scorecard analysis (push) Failing after 0s
Validate / eval (push) Failing after 0s
Security / Dependency audit (push) Failing after 1s
Security / Secret scan (push) Failing after 1s
Validate / tests (push) Failing after 0s
Validate / mcp-tests (push) Failing after 1s
GitHub Actions Security Analysis with zizmor 🌈 / zizmor (push) Failing after 1s
Security / SAST scan (push) Failing after 13m52s
chore: import upstream snapshot with attribution
2026-07-13 12:05:33 +08:00

18 lines
624 B
Python

from lib import env
def test_load_env_file_reads_utf8_regardless_of_locale(tmp_path):
# setup_wizard writes .env with encoding="utf-8"; the loader must read it
# back with the same encoding instead of the platform default (cp1252 on
# most Windows locales), or non-ASCII values raise UnicodeDecodeError.
env_path = tmp_path / ".env"
env_path.write_text(
"# café notes ☕\nDISPLAY_NAME=Zoë\nAPI_LABEL=日本語キー\n",
encoding="utf-8",
)
loaded = env.load_env_file(env_path)
assert loaded["DISPLAY_NAME"] == "Zoë"
assert loaded["API_LABEL"] == "日本語キー"