forked from J535D165/CoronaWatchNL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
45 lines (22 loc) · 752 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from pathlib import Path
import pandas
def test_national():
fp = Path("data", "rivm_NL_covid19_national.csv")
national = pandas.read_csv(fp)
# all datum have 3 items in group
assert (national.groupby("Datum")['Type'].count() == 3).all()
assert (national.groupby("Datum")['Type'].nunique() == 3).all()
def test_age():
print("test age")
fp = Path("data", "rivm_NL_covid19_age.csv")
df_age = pandas.read_csv(fp)
assert df_age["Aantal"].notnull().all()
def test_sex():
print("test gender")
fp = Path("data", "rivm_NL_covid19_sex.csv")
df_sex = pandas.read_csv(fp)
assert df_sex["Aantal"].notnull().all()
if __name__ == '__main__':
test_national()
test_age()
test_sex()