File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change 3
3
4
4
@pytest .fixture
5
5
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 ()
Original file line number Diff line number Diff line change 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" ]
6
5
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 )
You can’t perform that action at this time.
0 commit comments