mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 02:54:37 +00:00
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>
35 lines
801 B
Python
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
|