Guard pipe

This commit is contained in:
WQY\qiong
2023-03-22 20:58:45 +08:00
parent 236fcf0612
commit 6a304ba7e0
2 changed files with 19 additions and 1 deletions

View File

@@ -907,6 +907,8 @@ class TestApi:
assert is_junction(p, 'j3')
assert is_junction(p, 'j4')
assert get_pipe(p, 'p0') == {}
add_pipe(p, ChangeSet({'id': 'p0', 'node1': 'j1', 'node2': 'j2', 'length': 100.0, 'diameter': 10.0, 'roughness': 0.1, 'minor_loss': 0.5, 'status': PIPE_STATUS_OPEN }))
p0 = get_pipe(p, 'p0')
assert p0['node1'] == 'j1'
@@ -959,6 +961,8 @@ class TestApi:
links = get_links(p)
assert len(links) == 0
assert get_pipe(p, 'p0') == {}
self.leave(p)