generated from coulomb/repo-seed
confidence labels
This commit is contained in:
@@ -4,6 +4,28 @@ from repo_registry.web_api import app as app_module
|
||||
from repo_registry.web_api.app import Settings, app, get_service, get_settings
|
||||
|
||||
|
||||
def test_openapi_groups_agent_facing_endpoints():
|
||||
client = TestClient(app)
|
||||
|
||||
response = client.get("/openapi.json")
|
||||
|
||||
assert response.status_code == 200
|
||||
schema = response.json()
|
||||
assert {tag["name"] for tag in schema["tags"]} >= {
|
||||
"repositories",
|
||||
"analysis",
|
||||
"review",
|
||||
"registry",
|
||||
"search",
|
||||
}
|
||||
search_operation = schema["paths"]["/search"]["get"]
|
||||
assert search_operation["tags"] == ["search"]
|
||||
assert {
|
||||
parameter["name"]: parameter["description"]
|
||||
for parameter in search_operation["parameters"]
|
||||
}["q"].startswith("Natural-language")
|
||||
|
||||
|
||||
def test_api_manual_registry_loop(tmp_path):
|
||||
def override_settings():
|
||||
return Settings(
|
||||
@@ -323,6 +345,11 @@ def test_api_analysis_run_loop(tmp_path):
|
||||
ability_map = approve_response.json()
|
||||
assert ability_map["repository"]["status"] == "indexed"
|
||||
assert ability_map["abilities"][0]["name"] == "Frontend Delivery"
|
||||
assert ability_map["abilities"][0]["confidence_label"] in {
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
}
|
||||
assert ability_map["abilities"][0]["capabilities"][0]["name"] == (
|
||||
"Describe Frontend Stack"
|
||||
)
|
||||
@@ -331,6 +358,7 @@ def test_api_analysis_run_loop(tmp_path):
|
||||
assert search_response.status_code == 200
|
||||
assert search_response.json()
|
||||
assert "matched_field" in search_response.json()[0]
|
||||
assert "confidence_label" in search_response.json()[0]
|
||||
|
||||
filtered_search_response = client.get(
|
||||
"/search",
|
||||
@@ -348,6 +376,11 @@ def test_api_analysis_run_loop(tmp_path):
|
||||
assert abilities_response.status_code == 200
|
||||
assert abilities_response.json()[0]["name"] == "Frontend Delivery"
|
||||
assert abilities_response.json()[0]["repository_name"] == "Frontend"
|
||||
assert abilities_response.json()[0]["confidence_label"] in {
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
}
|
||||
|
||||
capabilities_response = client.get("/capabilities")
|
||||
assert capabilities_response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user