"""Tests for infrastructure config.""" from app.infrastructure.config import Settings class TestSettings: def test_default_values(self) -> None: """Test default settings values by creating settings without env file.""" # Create settings with no env file to test defaults s = Settings(_env_file=None) assert s.app_name == "Blog API" assert s.debug is False assert s.host == "0.0.0.0" assert s.port == 8000 assert s.database_url == "sqlite:///./blog.db" assert s.database_echo is False def test_custom_values(self) -> None: """Test custom settings values.""" s = Settings( app_name="Test API", debug=True, host="localhost", port=9000, database_url="postgresql://test", secret_key="test-secret", ) assert s.app_name == "Test API" assert s.debug is True assert s.host == "localhost" assert s.port == 9000 assert s.database_url == "postgresql://test" assert s.secret_key == "test-secret" def test_model_config(self) -> None: """Test settings model config.""" assert "env_file" in Settings.model_config