Skip to content

Commit 7c1faa8

Browse files
author
Ernesto Arandia
committed
adds assert to test_stepq
1 parent 2f6cc9f commit 7c1faa8

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

owa-epanet/test/test_owa_epanet.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def clean_dir():
2525

2626
def test_create_project():
2727
epanet_proj = en.createproject()
28-
assert(str(type(epanet_proj)) == '<class \'SwigPyObject\'>')
28+
assert str(type(epanet_proj)) == '<class \'SwigPyObject\'>'
2929

3030

3131
def test_open():
@@ -70,7 +70,7 @@ def test_save_inp_file():
7070
epanet_proj = en.createproject()
7171
en.open(ph=epanet_proj, inpFile=example_1_path, rptFile='report.rpt', outFile='output.out')
7272
en.saveinpfile(ph=epanet_proj, filename='saved_inp_file.inp')
73-
assert(os.path.isfile('saved_inp_file.inp'))
73+
assert os.path.isfile('saved_inp_file.inp')
7474
clean_dir()
7575

7676

@@ -79,7 +79,7 @@ def test_openh():
7979
en.open(ph=epanet_proj, inpFile=example_1_path, rptFile='report.rpt', outFile='output.out')
8080
res = en.openH(ph=epanet_proj)
8181
en.close(ph=epanet_proj)
82-
assert (not res)
82+
assert not res
8383
clean_dir()
8484

8585

@@ -89,7 +89,7 @@ def test_inith():
8989
en.openH(ph=epanet_proj)
9090
res = en.initH(ph=epanet_proj, initFlag=0)
9191
en.close(ph=epanet_proj)
92-
assert (not res)
92+
assert not res
9393
clean_dir()
9494

9595

@@ -100,7 +100,7 @@ def test_runh():
100100
en.initH(ph=epanet_proj, initFlag=0)
101101
res = en.runH(ph=epanet_proj)
102102
en.close(ph=epanet_proj)
103-
assert (res == 0)
103+
assert res == 0
104104
clean_dir()
105105

106106

@@ -112,7 +112,7 @@ def test_nexth():
112112
en.runH(ph=epanet_proj)
113113
res = en.nextH(ph=epanet_proj)
114114
en.close(ph=epanet_proj)
115-
assert (res == 3600)
115+
assert res == 3600
116116
clean_dir()
117117

118118

@@ -123,7 +123,7 @@ def test_closeh():
123123
en.initH(ph=epanet_proj, initFlag=0)
124124
res = en.closeH(ph=epanet_proj)
125125
en.close(ph=epanet_proj)
126-
assert (not res)
126+
assert not res
127127
clean_dir()
128128

129129

@@ -141,7 +141,7 @@ def test_inith_runh_nexth():
141141
break
142142
en.closeH(ph=epanet_proj)
143143
en.close(ph=epanet_proj)
144-
assert (tlist == timesteps)
144+
assert tlist == timesteps
145145
clean_dir()
146146

147147

@@ -152,7 +152,7 @@ def test_solveh_solveq():
152152
en.solveQ(ph=epanet_proj)
153153
en.report(ph=epanet_proj)
154154
en.close(ph=epanet_proj)
155-
assert (os.path.isfile('output.out'))
155+
assert os.path.isfile('output.out')
156156
clean_dir()
157157

158158

@@ -172,7 +172,7 @@ def test_initq_runq_nextq():
172172
en.closeQ(ph=epanet_proj)
173173
en.report(ph=epanet_proj)
174174
en.close(ph=epanet_proj)
175-
assert(tlist == timesteps)
175+
assert tlist == timesteps
176176
clean_dir()
177177

178178

@@ -191,6 +191,7 @@ def test_stepq():
191191
break
192192
en.closeQ(ph=epanet_proj)
193193
en.close(ph=epanet_proj)
194+
assert tlist[:60] == wq_times
194195
clean_dir()
195196

196197

@@ -235,8 +236,8 @@ def test_water_age_sim():
235236
en.closeQ(ph=epanet_proj)
236237
en.closeH(ph=epanet_proj)
237238
en.close(ph=epanet_proj)
238-
assert (age_list[26] == [1.0, 2.2141675704376946, 12.939125434025273, 24.44152992466322, 13.174235412569542,
239-
24.441519659540887, 15.679376648181817, 21.97064181429266, 19.048343501261524, 1.0])
239+
assert age_list[26] == [1.0, 2.2141675704376946, 12.939125434025273, 24.44152992466322, 13.174235412569542,
240+
24.441519659540887, 15.679376648181817, 21.97064181429266, 19.048343501261524, 1.0]
240241
clean_dir()
241242

242243

0 commit comments

Comments
 (0)