generated from coulomb/repo-seed
search filters and inspection polish
This commit is contained in:
@@ -137,6 +137,43 @@ def test_search_matches_features_and_evidence_with_context(tmp_path):
|
||||
assert evidence_results[0].confidence == 0.9
|
||||
|
||||
|
||||
def test_search_filters_by_status_language_and_framework(tmp_path):
|
||||
source = tmp_path / "repo"
|
||||
source.mkdir()
|
||||
(source / "README.md").write_text("# Filterable\n", encoding="utf-8")
|
||||
(source / "requirements.txt").write_text("fastapi\n", encoding="utf-8")
|
||||
(source / "app.py").write_text(
|
||||
"from fastapi import FastAPI\n"
|
||||
"app = FastAPI()\n"
|
||||
'@app.get("/health")\n'
|
||||
"def health():\n"
|
||||
" return {}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
service = make_service(tmp_path)
|
||||
repository = service.register_repository(name="Filterable", url=str(source))
|
||||
summary = service.analyze_repository(repository.id)
|
||||
service.approve_candidate_graph(repository.id, summary.analysis_run.id)
|
||||
|
||||
results = service.search(
|
||||
"repository",
|
||||
status="indexed",
|
||||
language="Python",
|
||||
framework="FastAPI",
|
||||
)
|
||||
wrong_language_results = service.search(
|
||||
"repository",
|
||||
status="indexed",
|
||||
language="TypeScript",
|
||||
framework="FastAPI",
|
||||
)
|
||||
|
||||
assert results
|
||||
assert {result.repository_name for result in results} == {"Filterable"}
|
||||
assert wrong_language_results == []
|
||||
|
||||
|
||||
def test_register_repository_imports_metadata_when_name_is_omitted(tmp_path):
|
||||
source = tmp_path / "metadata-source"
|
||||
source.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user