Skip to main content
Glama

LoreKeeper MCP

by frap129
test_config.py1.79 kB
"""Tests for configuration management.""" from pathlib import Path from lorekeeper_mcp.config import Settings, settings class TestSettings: """Test configuration loading and defaults.""" def test_settings_loads_defaults(self): """Test that settings loads with default values.""" assert settings.db_path == Path("./data/cache.db") assert settings.cache_ttl_days == 7 assert settings.error_cache_ttl_seconds == 300 assert settings.log_level == "INFO" assert settings.debug is False assert settings.open5e_base_url == "https://api.open5e.com" assert settings.dnd5e_base_url == "https://www.dnd5eapi.co/api" def test_settings_respects_env_vars(self, monkeypatch): """Test that settings respects environment variable overrides.""" # Set environment variables monkeypatch.setenv("DB_PATH", "./data/test.db") monkeypatch.setenv("CACHE_TTL_DAYS", "14") monkeypatch.setenv("ERROR_CACHE_TTL_SECONDS", "600") monkeypatch.setenv("LOG_LEVEL", "DEBUG") monkeypatch.setenv("DEBUG", "true") monkeypatch.setenv("OPEN5E_BASE_URL", "https://test.open5e.com") monkeypatch.setenv("DND5E_BASE_URL", "https://test.dnd5eapi.co/api") # Create a new Settings instance to pick up environment variables test_settings = Settings() assert test_settings.db_path == Path("./data/test.db") assert test_settings.cache_ttl_days == 14 assert test_settings.error_cache_ttl_seconds == 600 assert test_settings.log_level == "DEBUG" assert test_settings.debug is True assert test_settings.open5e_base_url == "https://test.open5e.com" assert test_settings.dnd5e_base_url == "https://test.dnd5eapi.co/api"

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/frap129/lorekeeper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server