-
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 test container * updated init.sql, added tests for addresses and seismic * updated env file ci workflow * updated test db url * added soft story tests * added all api tests * changed the order of coordinates * update ci tests
- Loading branch information
Showing
18 changed files
with
151 additions
and
244 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
router = APIRouter( | ||
prefix="/tsunami", | ||
prefix="/tsunami-zones", | ||
tags=[Tags.TSUNAMI], | ||
) | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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,10 @@ | ||
import pytest | ||
from backend.api.tests.test_session_config import test_engine, test_session, client | ||
|
||
|
||
def test_get_landslide_zones(client): | ||
response = client.get(f"/landslide-zones/") | ||
response_dict = response.json() | ||
print(response_dict["features"]) | ||
assert response.status_code == 200 | ||
assert len(response_dict["features"]) == 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pytest | ||
from backend.api.tests.test_session_config import test_engine, test_session, client | ||
|
||
|
||
def test_get_liquefaction_zones(client): | ||
response = client.get(f"/liquefaction-zones/") | ||
response_dict = response.json() | ||
assert response.status_code == 200 | ||
assert len(response_dict["features"]) == 3 |
This file was deleted.
Oops, something went wrong.
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,43 +1,9 @@ | ||
""" | ||
Test the API of soft_story.py. | ||
""" | ||
|
||
import pytest | ||
from fastapi.testclient import TestClient | ||
|
||
# Will the .. be stable? | ||
from ..main import app | ||
from ..schemas.geo import Polygon | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
return TestClient(app) | ||
|
||
|
||
def test_delete_soft_story(client): | ||
response = client.delete("/api/soft-story/address") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_put_soft_story(client): | ||
response = client.put("/api/soft-story/address?soft-story=true") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_post_soft_story(client): | ||
response = client.put("/api/soft-story/address?soft-story=true") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
from backend.api.tests.test_session_config import test_engine, test_session, client | ||
|
||
|
||
def test_get_soft_story(client): | ||
response = client.get("/api/soft-story/address") | ||
def test_get_soft_stories(client): | ||
response = client.get(f"/soft-stories/") | ||
response_dict = response.json() | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
assert len(response_dict["features"]) == 6 |
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,54 +1,9 @@ | ||
""" | ||
Test the API of tsunami.py. | ||
""" | ||
|
||
import pytest | ||
from fastapi.testclient import TestClient | ||
|
||
# Will the .. be stable? | ||
from ..main import app | ||
from ..schemas.geo import Polygon | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
return TestClient(app) | ||
|
||
|
||
def test_delete_tsunami_polygon(client): | ||
response = client.delete("/api/polygons/1?table_name=tsunami") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_put_tsunami_polygon(client): | ||
response = client.put( | ||
"/api/polygons/1?table_name=tsunami", json=Polygon().model_dump() | ||
) | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_post_tsunami_polygon(client): | ||
response = client.put( | ||
"/api/polygons/1?table_name=tsunami", json=Polygon().model_dump() | ||
) | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
|
||
|
||
def test_get_tsunami_polygon(client): | ||
response = client.get("/api/polygons/1?table_name=tsunami") | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
from backend.api.tests.test_session_config import test_engine, test_session, client | ||
|
||
|
||
def test_get_tsunami_risk(client): | ||
response = client.get("/api/tsunami-risk/addresss") | ||
def test_get_tsunami_zones(client): | ||
response = client.get(f"/tsunami-zones/") | ||
response_dict = response.json() | ||
assert response.status_code == 200 | ||
# Temporary guaranteed failure until test is written | ||
assert False | ||
assert len(response_dict["features"]) == 1 |
Oops, something went wrong.