Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /fanqingsong_fastapi-hive /tests /test_api /test_prediction.py
| from example.cornerstone import config | |
| def test_prediction(test_client) -> None: | |
| response = test_client.post( | |
| "/api/house_price/predict", | |
| json={ | |
| "median_income_in_block": 8.3252, | |
| "median_house_age_in_block": 41, | |
| "average_rooms": 6, | |
| "average_bedrooms": 1, | |
| "population_per_block": 322, | |
| "average_house_occupancy": 2.55, | |
| "block_latitude": 37.88, | |
| "block_longitude": -122.23 | |
| }, | |
| headers={"token": str(config.API_KEY)} | |
| ) | |
| assert response.status_code == 200 | |
| assert "median_house_value" in response.json() | |
| assert "currency" in response.json() | |
| def test_prediction_nopayload(test_client) -> None: | |
| response = test_client.post( | |
| "/api/house_price/predict", | |
| json={}, | |
| headers={"token": str(config.API_KEY)} | |
| ) | |
| assert response.status_code == 422 | |
Xet Storage Details
- Size:
- 916 Bytes
- Xet hash:
- 2be87cae7cffc431942cf9832dc67197b68f87ef0676012f0caab51da5353a9b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.