-
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.
Added a test container and sample tests (#123)
* added test container * updated init.sql, added tests for addresses and seismic * updated env file ci workflow * updated test db url
- Loading branch information
Showing
15 changed files
with
81 additions
and
67 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
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
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
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
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 |
---|---|---|
@@ -1,50 +1,10 @@ | ||
import pytest | ||
from fastapi.testclient import TestClient | ||
from backend.api.tests.test_session_config import test_engine, test_session, client | ||
|
||
# Will the .. be stable? | ||
from ..main import app | ||
from ..schemas.geo import Polygon | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
return TestClient(app) | ||
|
||
|
||
def test_delete_polygon(client): | ||
response = client.delete("/api/polygons/1?table_name=seismic") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_put_polygon(client): | ||
response = client.put( | ||
"/api/polygons/1?table_name=seismic", json=Polygon().model_dump() | ||
) | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_post_polygon(client): | ||
response = client.put( | ||
"/api/polygons/1?table_name=seismic", json=Polygon().model_dump() | ||
) | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_get_polygon(client): | ||
response = client.get("/api/polygons/1?table_name=seismic") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_get_seismic_risk(client): | ||
response = client.get("/api/seismic-risk/address") | ||
def test_get_seismic_hazard_zones(client): | ||
response = client.get(f"/seismic-zones/") | ||
response_dict = response.json() | ||
print(response_dict) | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
assert len(response_dict) == 2 |
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
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