-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from PolicyEngine/feat/add_demo_endpoint
Added calculate_demo endpoint for use on API documentation page
- Loading branch information
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- bump: patch | ||
changes: | ||
changed: | ||
- Added calculate_demo endpoint for use on API documentation page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
import os | ||
from tests.python.utils import client | ||
from policyengine_household_api.api import app | ||
|
||
|
||
def test_calc_demo(client): | ||
""" | ||
Ensure that calculate_demo properly calculates; | ||
the rate limiter does not return a 4xx, but instead | ||
waits until the rate limit has ended, preventing the | ||
need for a further test | ||
""" | ||
|
||
response = client.post( | ||
"/us/calculate_demo", | ||
headers={ | ||
"Content-Type": "application/json", | ||
}, | ||
data=open( | ||
"./tests/python/data/calculate_us_1_data.json", | ||
"r", | ||
encoding="utf-8", | ||
), | ||
) | ||
assert response.status_code == 200, response.text |