Skip to content

Commit 2f4f17c

Browse files
committed
Bump version to 2.1.1 and add prospects tests
Update package version to 2.1.1 in app/__init__.py and add a new test (tests/test_prospects.py) that exercises the /prospects endpoint using FastAPI TestClient. The test asserts a 200 response, checks that the payload contains "meta" and "data" (with data as a list), verifies presence of expected keys in data items ("init" and "search"), and validates meta fields (severity and message). This adds basic endpoint coverage to prevent regressions.
1 parent 827f504 commit 2f4f17c

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Python - FastAPI, Postgres, tsvector"""
22

33
# Current Version
4-
__version__ = "2.1.0"
4+
__version__ = "2.1.1"

tests/test_prospects.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
from fastapi.testclient import TestClient
3+
from app.main import app
4+
5+
client = TestClient(app)
6+
7+
def test_get_prospects_root():
8+
response = client.get("/prospects")
9+
assert response.status_code == 200
10+
data = response.json()
11+
assert "meta" in data
12+
assert "data" in data
13+
assert isinstance(data["data"], list)
14+
# Check that the expected keys are present in the data list
15+
assert any("init" in item for item in data["data"])
16+
assert any("search" in item for item in data["data"])
17+
# Meta checks
18+
meta = data["meta"]
19+
assert meta["severity"] == "success"
20+
assert meta["message"] == "Prospects endpoint"

0 commit comments

Comments
 (0)