Skip to content

Commit d615e56

Browse files
author
PJ Hoberman
committed
#179 Updated tests to match new chart and param functions
1 parent 4b493a2 commit d615e56

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_app.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ def test_sim_sir():
160160

161161
def test_new_admissions_chart():
162162
projection_admits = pd.read_csv('tests/projection_admits.csv')
163-
chart = new_admissions_chart(alt, projection_admits, 60 - 10)
163+
chart = new_admissions_chart(alt, projection_admits, PARAM)
164164
assert isinstance(chart, alt.Chart)
165-
assert chart.data.iloc[1].Hospitalized < 1
166-
assert round(chart.data.iloc[40].ICU, 0) == 25
165+
assert chart.data.iloc[1].hosp < 1
166+
assert round(chart.data.iloc[40].icu, 0) == 25
167167

168168
# test fx call with no params
169169
with pytest.raises(TypeError):
@@ -175,16 +175,16 @@ def test_new_admissions_chart():
175175

176176
def test_admitted_patients_chart():
177177
census_df = pd.read_csv('tests/census_df.csv')
178-
chart = admitted_patients_chart(alt, census_df, 60 - 10)
178+
chart = admitted_patients_chart(alt, census_df, PARAM)
179179
assert isinstance(chart, alt.Chart)
180-
assert chart.data.iloc[1]['Hospital Census'] == 1
181-
assert chart.data.iloc[49]['Ventilated Census'] == 203
180+
assert chart.data.iloc[1].hosp == 1
181+
assert chart.data.iloc[49].vent == 203
182182

183183
# test fx call with no params
184184
with pytest.raises(TypeError):
185185
admitted_patients_chart()
186186

187-
empty_chart = admitted_patients_chart(alt, pd.DataFrame(), -1)
187+
empty_chart = admitted_patients_chart(alt, pd.DataFrame(), PARAM)
188188
assert empty_chart.data.empty
189189

190190

0 commit comments

Comments
 (0)