test: add unit test suite for config, health checks, and lifespan wiring
This commit is contained in:
27
tests/unit/test_config.py
Normal file
27
tests/unit/test_config.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from src.config import Settings
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
def test_settings_loads_defaults_without_env_file() -> None:
|
||||
settings = Settings(_env_file=None)
|
||||
|
||||
assert settings.postgres.port == 5433
|
||||
assert settings.minio.bucket == "chatbot-source-files"
|
||||
assert settings.ingestion.max_concurrency == 4
|
||||
assert settings.qdrant.url == "http://127.0.0.1:6343"
|
||||
|
||||
|
||||
def test_settings_parses_env_example() -> None:
|
||||
env_example = Path(__file__).parent.parent.parent / ".env.example"
|
||||
|
||||
settings = Settings(_env_file=env_example)
|
||||
|
||||
assert settings.postgres.host == "127.0.0.1"
|
||||
assert settings.minio.endpoint == "127.0.0.1:9100"
|
||||
assert settings.ingestion.embed_batch_size == 128
|
||||
assert settings.qdrant.api_key is None
|
||||
Reference in New Issue
Block a user