Update tank api and test
This commit is contained in:
@@ -21,7 +21,7 @@ def get_junction_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
|
||||
|
||||
def _query_junction(name: str, id: str) -> Row | None:
|
||||
return read(name, f"select id, elevation, demand, pattern from junctions where id = '{id}'")
|
||||
return read(name, f"select * from junctions where id = '{id}'")
|
||||
|
||||
|
||||
def add_junction(name: str, id: str, x: float, y: float, elevation: float) -> ChangeSet:
|
||||
@@ -59,6 +59,9 @@ def get_junction(name: str, id: str) -> dict[str, Any] | None:
|
||||
def set_junction(name: str, id: str, properties: dict[str, Any]) -> ChangeSet:
|
||||
if not is_junction(name, id):
|
||||
return ChangeSet()
|
||||
if 'pattern' in properties:
|
||||
if not is_pattern(properties['pattern']):
|
||||
return ChangeSet()
|
||||
|
||||
old = Serialize(get_junction(name, id), schema).to_storage()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user