Setting of valve [GPV] should be string
This commit is contained in:
@@ -1347,13 +1347,13 @@ class TestApi:
|
||||
assert is_junction(p, 'j3')
|
||||
assert is_junction(p, 'j4')
|
||||
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': '0.1', 'minor_loss': 0.5 }))
|
||||
v0 = get_valve(p, 'v0')
|
||||
assert v0['node1'] == 'j1'
|
||||
assert v0['node2'] == 'j2'
|
||||
assert v0['diameter'] == 10.0
|
||||
assert v0['v_type'] == VALVES_TYPE_FCV
|
||||
assert v0['setting'] == 0.1
|
||||
assert v0['setting'] == '0.1'
|
||||
assert v0['minor_loss'] == 0.5
|
||||
|
||||
set_valve(p, ChangeSet({'id': 'v0', 'node1': 'j3', 'node2': 'j4'}))
|
||||
@@ -1369,15 +1369,15 @@ class TestApi:
|
||||
v0 = get_valve(p, 'v0')
|
||||
assert v0['v_type'] == VALVES_TYPE_GPV
|
||||
|
||||
set_valve(p, ChangeSet({'id': 'v0', 'setting': 0.2}))
|
||||
set_valve(p, ChangeSet({'id': 'v0', 'setting': '0.2'}))
|
||||
v0 = get_valve(p, 'v0')
|
||||
assert v0['setting'] == 0.2
|
||||
assert v0['setting'] == '0.2'
|
||||
|
||||
set_valve(p, ChangeSet({'id': 'v0', 'minor_loss': 0.1}))
|
||||
v0 = get_valve(p, 'v0')
|
||||
assert v0['minor_loss'] == 0.1
|
||||
|
||||
add_valve(p, ChangeSet({'id': 'v1', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
add_valve(p, ChangeSet({'id': 'v1', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': '0.1', 'minor_loss': 0.5 }))
|
||||
links = get_links(p)
|
||||
assert len(links) == 2
|
||||
assert links[0] == 'v0'
|
||||
@@ -1410,7 +1410,7 @@ class TestApi:
|
||||
assert is_junction(p, 'j3')
|
||||
assert is_junction(p, 'j4')
|
||||
|
||||
cs = add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 })).operations[0]
|
||||
cs = add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': '0.1', 'minor_loss': 0.5 })).operations[0]
|
||||
assert cs['operation'] == 'add'
|
||||
assert cs['type'] == VALVE
|
||||
assert cs['id'] == 'v0'
|
||||
@@ -1418,7 +1418,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j2'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
cs = execute_undo(p).operations[0]
|
||||
@@ -1434,7 +1434,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j2'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
cs = execute_undo(p, True).operations[0]
|
||||
@@ -1448,7 +1448,7 @@ class TestApi:
|
||||
links = get_links(p)
|
||||
assert len(links) == 0
|
||||
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j1', 'node2': 'j2', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': '0.1', 'minor_loss': 0.5 }))
|
||||
|
||||
links = get_links(p)
|
||||
assert len(links) == 1
|
||||
@@ -1466,7 +1466,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j2'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
cs = execute_redo(p).operations[0]
|
||||
@@ -1482,7 +1482,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j2'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
cs = execute_redo(p)
|
||||
@@ -1499,7 +1499,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j4'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
cs = execute_undo(p).operations[0]
|
||||
@@ -1510,7 +1510,7 @@ class TestApi:
|
||||
assert cs['node2'] == 'j2'
|
||||
assert cs['diameter'] == 10.0
|
||||
assert cs['v_type'] == VALVES_TYPE_FCV
|
||||
assert cs['setting'] == 0.1
|
||||
assert cs['setting'] == '0.1'
|
||||
assert cs['minor_loss'] == 0.5
|
||||
|
||||
self.leave(p)
|
||||
@@ -1522,7 +1522,7 @@ class TestApi:
|
||||
|
||||
add_junction(p, ChangeSet({'id': 'j0', 'x': 0.0, 'y': 10.0, 'elevation': 20.0}))
|
||||
add_junction(p, ChangeSet({'id': 'j1', 'x': 0.0, 'y': 10.0, 'elevation': 20.0}))
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j0', 'node2': 'j1', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': 0.1, 'minor_loss': 0.5 }))
|
||||
add_valve(p, ChangeSet({'id': 'v0', 'node1': 'j0', 'node2': 'j1', 'diameter': 10.0, 'v_type': VALVES_TYPE_FCV, 'setting': '0.1', 'minor_loss': 0.5 }))
|
||||
set_tag(p, ChangeSet({'t_type': TAG_TYPE_LINK, 'id': 'v0', 'tag': 'v0t' }))
|
||||
set_status(p, ChangeSet({'link': 'v0', 'status': LINK_STATUS_OPEN, 'setting': 10.0}))
|
||||
set_vertex(p, ChangeSet({'link' : 'v0', 'coords': [{'x': 1.0, 'y': 2.0}, {'x': 2.0, 'y': 1.0}]}))
|
||||
|
||||
Reference in New Issue
Block a user