fix: replace hardcoded tokendb path
All checks were successful
PR Tests / test (pull_request) Successful in 1m0s
NYX Security Scan / nyx-scan (pull_request) Successful in 6m24s

This commit is contained in:
Alpha Nerd 2026-05-17 10:53:33 +02:00
parent 29ee360082
commit 0b64a84e96
Signed by: alpha-nerd
SSH key fingerprint: SHA256:QkkAgVoYi9TQ0UKPkiKSfnerZy2h4qhi3SVPXJmBN+M
3 changed files with 13 additions and 4 deletions

View file

@ -16,6 +16,7 @@ import asyncio
import os
import ssl
import sys
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
@ -24,8 +25,14 @@ import httpx
import pytest
_TEST_DIR = Path(__file__).parent
# Must be set before importing router so the module-level Config.from_yaml uses test config
# Must be set before importing router so module-level Config.from_yaml + Config field
# defaults pick these up. db_path is intentionally absent from config_test.yaml so the
# env-var default wins — keeps tests portable across CI runners (Linux/macOS/Windows).
os.environ.setdefault("NOMYO_ROUTER_CONFIG_PATH", str(_TEST_DIR / "config_test.yaml"))
os.environ.setdefault(
"NOMYO_ROUTER_DB_PATH",
str(Path(tempfile.gettempdir()) / "nomyo_router_test_tokens.db"),
)
sys.path.insert(0, str(_TEST_DIR.parent))