acupedia-ops/tests/local/test_env.py

17 lines
382 B
Python

from pathlib import Path
from acupedia_ops.common.env import parse_env_file
def test_parse_env_file(tmp_path: Path) -> None:
path = tmp_path / ".env"
path.write_text(
"A=1\nexport B='two words'\n# comment\nC=\"three\"\n",
encoding="utf-8",
)
assert parse_env_file(path) == {
"A": "1",
"B": "two words",
"C": "three",
}