generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added general LowerColorado Test case for API
- Loading branch information
Showing
9 changed files
with
211 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from pathlib import Path | ||
from typing import Dict, List | ||
|
||
|
||
def update_test_paths_with_prefix(data: Dict[str, str], prefix: Path, paths_to_update: List[List[str]]) -> Dict[str, str]: | ||
"""Update specific paths inside of a config dictionary with the given prefix, if they exist. | ||
Parameters: | ||
----------- | ||
data: Dict[str, str] | ||
The data dictionary read from the yaml config | ||
prefix: Path | ||
The path prefix we want to append | ||
paths_to_update: List[str] | ||
The list of paths to update from the config | ||
Returns: | ||
-------- | ||
Dict[str, str] | ||
The updated data dictionary | ||
""" | ||
|
||
for keys in paths_to_update: | ||
current = data | ||
for key in keys[:-1]: | ||
if key in current: | ||
current = current[key] | ||
else: | ||
break | ||
if keys[-1] in current: | ||
current[keys[-1]] = (prefix / current[keys[-1]]).__str__() | ||
|
||
return data |
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,22 +1,48 @@ | ||
"""Author: Tadd Bindas""" | ||
from enum import IntEnum | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class HttpStatusCode(IntEnum): | ||
OK = 200 | ||
CREATED = 201 | ||
ACCEPTED = 202 | ||
BAD_REQUEST = 400 | ||
UNAUTHORIZED = 401 | ||
FORBIDDEN = 403 | ||
NOT_FOUND = 404 | ||
INTERNAL_SERVER_ERROR = 500 | ||
|
||
|
||
class TRouteStatus(BaseModel): | ||
""" | ||
A schema to define successful t-route output | ||
"""A schema to define successful t-route output | ||
Attributes | ||
---------- | ||
Attributes: | ||
----------- | ||
status_code: HttpStatusCode | ||
The HTTP status code output from the code run | ||
message: str | ||
The | ||
The output message from T-Route | ||
lid : str | ||
The location ID belonging to the point being routed | ||
feature_id : str | ||
The COMID, or hf_id, belonging to the point being routed | ||
""" | ||
|
||
status_code: HttpStatusCode | ||
message: str | ||
lid: str | ||
feature_id: str | ||
|
||
|
||
class TestStatus(BaseModel): | ||
"""A schema for output from t-route test cases | ||
Attributes: | ||
----------- | ||
status_code: HttpStatusCode | ||
The HTTP status code output from the code run | ||
message: str | ||
The output message from T-Route | ||
""" | ||
status_code: HttpStatusCode | ||
message: str |
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 |
---|---|---|
|
@@ -21,5 +21,4 @@ services: | |
interval: 30s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 5s | ||
|
||
start_period: 5s |