Skip to content

Commit 9947fe5

Browse files
ffixing tests
1 parent 2a40b7a commit 9947fe5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/test_app.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
from penn_chime.charts import new_admissions_chart
1212
from penn_chime.settings import DEFAULTS
1313
from penn_chime.defaults import RateLos
14-
14+
PARAM = Parameters(
15+
current_hospitalized=100,
16+
doubling_time=6.0,
17+
known_infected=5000,
18+
market_share=0.05,
19+
relative_contact_rate=0.15,
20+
susceptible=500000,
21+
hospitalized=RateLos(0.05, 7),
22+
icu=RateLos(0.02, 9),
23+
ventilated=RateLos(0.01, 10),
24+
n_days=60
25+
)
1526

1627
# set up
1728

@@ -43,7 +54,7 @@ def cleanup(self):
4354

4455
def test_penn_logo_in_header():
4556
penn_css = '<link rel="stylesheet" href="https://www1.pennmedicine.org/styles/shared/penn-medicine-header.css">'
46-
display_header(st, DEFAULTS)
57+
display_header(st, PARAM)
4758
assert len(
4859
list(filter(lambda s: penn_css in s, st.render_store))
4960
), "The Penn Medicine header should be printed"
@@ -152,7 +163,7 @@ def test_sim_sir_df():
152163
Rounding to move fast past decimal place issues
153164
"""
154165

155-
df = sim_sir_df(DEFAULTS)
166+
df = sim_sir_df(PARAM)
156167
first = df.iloc[0]
157168
last = df.iloc[-1]
158169
assert round(first[0], 0) == 5
@@ -164,7 +175,7 @@ def test_sim_sir_df():
164175

165176

166177
def test_new_admissions_chart():
167-
chart = new_admissions_chart(alt, projection_admits, DEFAULTS)
178+
chart = new_admissions_chart(alt, projection_admits, PARAM)
168179
assert isinstance(chart, alt.Chart)
169180
assert chart.data.iloc[1].Hospitalized < 1
170181
# assert round(chart.data.iloc[49].ICU, 0) == 43

0 commit comments

Comments
 (0)