Files
routstr-core/tests/unit/test_logging.py
T
Cursor Agentanddb2002dominic 3258231507 Refactor: Improve auth, testing, and admin features
This commit includes several improvements:
- Enhanced authentication logic for API keys, including better handling of insufficient reserved balances and partial reverts.
- Added comprehensive unit and integration tests for various components, including admin functionalities, cost calculations, discovery services, and upstream provider integrations.
- Introduced new admin endpoints for managing models, providers, and settings, along with robust authentication and authorization mechanisms.
- Refined logging and middleware functionalities for better observability and request handling.
- Implemented NIP-91 provider announcement and discovery features.
- Added end-to-end tests for key user workflows.

Co-authored-by: db2002dominic <db2002dominic@gmail.com>
2025-11-16 21:40:25 +00:00

35 lines
801 B
Python

"""Unit tests for logging functionality."""
import pytest
from unittest.mock import patch
def test_get_logger() -> None:
"""Test get_logger function."""
from routstr.core.logging import get_logger
logger = get_logger("test_module")
assert logger is not None
assert logger.name == "test_module"
def test_logger_configuration() -> None:
"""Test logger configuration."""
from routstr.core.logging import get_logger
logger = get_logger("test_module")
assert logger.level is not None
def test_structured_logging() -> None:
"""Test structured logging formatters."""
from routstr.core.logging import get_logger
logger = get_logger("test_module")
logger.info("Test message", extra={"key": "value"})
assert True