Skip to content

Commit a143f15

Browse files
committed
changes
1 parent 13945e4 commit a143f15

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

backend/tests/conftest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33

44
@pytest.fixture
55
def client():
6-
flask_app.config["TESTING"] = True
7-
with flask_app.test_client() as client:
8-
yield client
6+
return flask_app.test_client()

backend/tests/test_basic.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
def test_health_check(client):
2-
# Simple check for /api/submit-tax GET to verify server is running
3-
response = client.get("/api/submit-tax")
4-
assert response.status_code == 200
5-
assert isinstance(response.get_json(), list)
1+
def test_submit_tax_post(client):
2+
res = client.post("/api/submit-tax", json={"name": "John", "income": 40000})
3+
assert res.status_code == 201
4+
assert "Received tax info." in res.get_json()["message"]
65

7-
8-
# def test_advice_route(client, mocker):
9-
# mock_response = {"advice": "Dummy"}
10-
# mock_openai = mocker.patch(
11-
# "openai.ChatCompletion.create", return_value=mock_response
12-
# )
13-
# response = client.post("/api/advice", json={"data": "test"})
14-
# assert response.status_code == 200
15-
# assert "advice" in response.json
6+
def test_submit_tax_get(client):
7+
res = client.get("/api/submit-tax")
8+
assert res.status_code == 200
9+
assert isinstance(res.get_json(), list)

0 commit comments

Comments
 (0)