lix / tests /test_env_loading.py
3v324v23's picture
feat: add user field to call analysis, format start dates, and refactor env loading
cb2d3eb
Raw
History Blame Contribute Delete
525 Bytes
import os
from calls_analyser.env import load_environment
def test_load_environment_strips_utf8_bom_from_first_key(tmp_path, monkeypatch):
env_file = tmp_path / ".env"
env_file.write_text(
"\ufeffGOOGLE_APPLICATION_CREDENTIALS=C:\\keys\\service-account.json\n",
encoding="utf-8",
)
monkeypatch.delenv("GOOGLE_APPLICATION_CREDENTIALS", raising=False)
assert load_environment(env_file) is True
assert os.environ["GOOGLE_APPLICATION_CREDENTIALS"] == "C:\\keys\\service-account.json"