generated from coulomb/repo-seed
Coevolution extension
This commit is contained in:
@@ -87,3 +87,32 @@ def test_scanner_javascript_typescript_package_records_package_facts(tmp_path):
|
||||
assert ("framework", "Vitest", "package.json") in facts
|
||||
assert ("interface", "possible API surface", "src/api/routes.ts") in facts
|
||||
assert ("test", "routes.spec.ts", "src/api/routes.spec.ts") in facts
|
||||
|
||||
|
||||
def test_scanner_records_llm_provider_and_fallback_facts(tmp_path):
|
||||
repo = tmp_path / "llm-connect-like"
|
||||
repo.mkdir()
|
||||
(repo / "README.md").write_text(
|
||||
"# LLM Connect\nSupports OpenRouter and Claude fallback.\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(repo / ".env.example").write_text(
|
||||
"OPENROUTER_API_KEY=\nANTHROPIC_API_KEY=\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
(repo / "providers.py").write_text(
|
||||
"provider_registry = {'openrouter': OpenRouterAdapter, 'anthropic': ClaudeAdapter}\n"
|
||||
"fallback_provider = 'claude'\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = DeterministicScanner().scan(repo)
|
||||
|
||||
facts = {(fact.kind, fact.name, fact.path) for fact in result.facts}
|
||||
assert ("llm_provider", "OpenRouter", "README.md") in facts
|
||||
assert ("llm_provider", "Claude", "README.md") in facts
|
||||
assert ("llm_provider", "Anthropic", ".env.example") in facts
|
||||
assert ("credential_config", "OpenRouter API key", ".env.example") in facts
|
||||
assert ("credential_config", "Anthropic API key", ".env.example") in facts
|
||||
assert ("provider_registry", "LLM provider registry", "providers.py") in facts
|
||||
assert ("fallback_policy", "LLM provider fallback policy", "README.md") in facts
|
||||
|
||||
Reference in New Issue
Block a user