1
1
"""Tests."""
2
2
3
- import pytest
4
- import pandas as pd
5
- import numpy as np
3
+ import pytest # type: ignore
4
+ import pandas as pd # type: ignore
5
+ import numpy as np # type: ignore
6
6
7
7
from app import (projection_admits , alt )
8
8
from penn_chime .models import sir , sim_sir , sim_sir_df
@@ -43,7 +43,7 @@ def cleanup(self):
43
43
44
44
def test_penn_logo_in_header ():
45
45
penn_css = '<link rel="stylesheet" href="https://www1.pennmedicine.org/styles/shared/penn-medicine-header.css">'
46
- display_header (st , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
46
+ display_header (st , DEFAULTS )
47
47
assert len (
48
48
list (filter (lambda s : penn_css in s , st .render_store ))
49
49
), "The Penn Medicine header should be printed"
@@ -65,7 +65,7 @@ def test_header_fail():
65
65
Just proving to myself that these tests work
66
66
"""
67
67
some_garbage = "ajskhlaeHFPIQONOI8QH34TRNAOP8ESYAW4"
68
- display_header (st , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 )
68
+ display_header (st , DEFAULTS )
69
69
assert len (
70
70
list (filter (lambda s : some_garbage in s , st .render_store ))
71
71
), "This should fail"
@@ -152,7 +152,7 @@ def test_sim_sir_df():
152
152
Rounding to move fast past decimal place issues
153
153
"""
154
154
155
- df = sim_sir_df (5 , 6 , 7 , 0.1 , 0.1 , 40 )
155
+ df = sim_sir_df (DEFAULTS )
156
156
first = df .iloc [0 ]
157
157
last = df .iloc [- 1 ]
158
158
assert round (first [0 ], 0 ) == 5
@@ -164,7 +164,7 @@ def test_sim_sir_df():
164
164
165
165
166
166
def test_new_admissions_chart ():
167
- chart = new_admissions_chart (alt , projection_admits , 60 - 10 )
167
+ chart = new_admissions_chart (alt , projection_admits , DEFAULTS )
168
168
assert isinstance (chart , alt .Chart )
169
169
assert chart .data .iloc [1 ].Hospitalized < 1
170
170
# assert round(chart.data.iloc[49].ICU, 0) == 43
0 commit comments