Files
javadandCursor b93ecf1691 Initial commit of the Kamidso API.
Keep source, config, and deploy files. Leave runtime data, uploads, and logs out of git.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 13:43:09 +03:30

22 lines
852 B
Python

import os
from pathlib import Path
from kamidso.bootstrap.env_file import load_app_env
from kamidso.settings.paths import repo_root
def test_load_app_env_reads_backend_dotenv(tmp_path, monkeypatch):
monkeypatch.delenv("KAMIDSO_JWT_SECRET_TEST_ONLY", raising=False)
env_file = tmp_path / ".env"
env_file.write_text("KAMIDSO_JWT_SECRET_TEST_ONLY=from-file\n", encoding="utf-8")
assert load_app_env(env_file) == env_file
assert os.environ["KAMIDSO_JWT_SECRET_TEST_ONLY"] == "from-file"
monkeypatch.setenv("KAMIDSO_JWT_SECRET_TEST_ONLY", "already-set")
env_file.write_text("KAMIDSO_JWT_SECRET_TEST_ONLY=ignored\n", encoding="utf-8")
load_app_env(env_file)
assert os.environ["KAMIDSO_JWT_SECRET_TEST_ONLY"] == "already-set"
def test_app_root_env_example_exists():
assert (repo_root() / ".env.example").is_file()