Skip to content

Commit 77585e5

Browse files
committed
Rename meta keys and update tests
Change meta payload keys in make_meta: replace "message" with "title" and "base_url" with "base". Update tests to expect the new "title" key and add a test for /prospects list. Remove the redundant tests/prospects/test_prospects.py file to consolidate test coverage.
1 parent 2f4f17c commit 77585e5

3 files changed

Lines changed: 11 additions & 34 deletions

File tree

app/utils/make_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ def make_meta(severity: str, title: str) -> dict:
1010
"version": __version__,
1111
"time": epoch,
1212
"severity": severity,
13-
"message": title,
14-
"base_url": base_url,
13+
"title": title,
14+
"base": base_url,
1515
}

tests/prospects/test_prospects.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/test_prospects.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,12 @@ def test_get_prospects_root():
1717
# Meta checks
1818
meta = data["meta"]
1919
assert meta["severity"] == "success"
20-
assert meta["message"] == "Prospects endpoint"
20+
assert meta["title"] == "Prospects endpoint"
21+
22+
def test_prospects_returns_list():
23+
response = client.get("/prospects")
24+
assert response.status_code == 200
25+
data = response.json()
26+
assert "meta" in data
27+
assert "data" in data
28+
assert isinstance(data["data"], list) or isinstance(data["data"], dict)

0 commit comments

Comments
 (0)