Add reservoir test case
This commit is contained in:
@@ -23,10 +23,7 @@ def get_node_coord(name: str, id: str) -> dict[str, float] | None:
|
||||
return _to_point(coord)
|
||||
|
||||
|
||||
def set_node_coord(name: str, id: str, x: float, y: float) -> ChangeSet:
|
||||
if not is_junction(name, id):
|
||||
return ChangeSet()
|
||||
|
||||
def set_node_coord(name: str, node_type: str, id: str, x: float, y: float) -> ChangeSet:
|
||||
old = get_node_coord(name, id)
|
||||
if old == None:
|
||||
return ChangeSet()
|
||||
@@ -42,5 +39,5 @@ def set_node_coord(name: str, id: str, x: float, y: float) -> ChangeSet:
|
||||
add_operation(name, redo, undo)
|
||||
|
||||
change = ChangeSet()
|
||||
change.update('junction', id, 'coord', 'point', str({'x': x, 'y': y}))
|
||||
change.update(node_type, id, 'coord', 'point', str({'x': x, 'y': y}))
|
||||
return change
|
||||
|
||||
Reference in New Issue
Block a user