1
+ import os
1
2
from epidatpy .request import Epidata , EpiRange
2
3
3
4
# Requirements to run these:
4
- # DELPHI_EPIDATA_KEY environment variable is set https://api.delphi.cmu.edu/epidata/admin/registration_form
5
+ # - DELPHI_EPIDATA_KEY environment variable is set https://api.delphi.cmu.edu/epidata/admin/registration_form
6
+ # - it has access to the private endpoints being tested
7
+
8
+ auth = os .environ .get ("DELPHI_EPIDATA_KEY" )
9
+
10
+ def test_pvt_cdc () -> None :
11
+ apicall = Epidata .pvt_cdc (
12
+ auth = auth ,
13
+ locations = "fl,ca" ,
14
+ epiweeks = EpiRange (201501 , 201601 )
15
+ )
16
+ data = apicall .json ()
17
+ assert (len (data ) > 0 )
5
18
6
19
def test_pub_covid_hosp_facility_lookup () -> None :
7
20
apicall = Epidata .pub_covid_hosp_facility_lookup (state = "fl" )
@@ -74,6 +87,16 @@ def test_pub_dengue_nowcast() -> None:
74
87
data = apicall .json ()
75
88
assert (len (data ) > 0 )
76
89
90
+ def test_pvt_dengue_sensors () -> None :
91
+ apicall = Epidata .pvt_dengue_sensors (
92
+ auth = auth ,
93
+ names = "ght" ,
94
+ locations = "ag" ,
95
+ epiweeks = EpiRange (201501 , 202001 )
96
+ )
97
+ data = apicall .json ()
98
+ assert (len (data ) > 0 )
99
+
77
100
def test_pub_ecdc_ili () -> None :
78
101
apicall = Epidata .pub_ecdc_ili (
79
102
regions = "austria" ,
@@ -119,6 +142,16 @@ def test_pub_gft() -> None:
119
142
data = apicall .json ()
120
143
assert (len (data ) > 0 )
121
144
145
+ def test_pvt_ght () -> None :
146
+ apicall = Epidata .pvt_ght (
147
+ auth = auth ,
148
+ locations = "ma" ,
149
+ epiweeks = EpiRange (199301 , 202304 ),
150
+ query = "how to get over the flu"
151
+ )
152
+ data = apicall .json ()
153
+ assert (len (data ) > 0 )
154
+
122
155
def test_pub_kcdc_ili () -> None :
123
156
apicall = Epidata .pub_kcdc_ili (
124
157
regions = "ROK" ,
@@ -127,6 +160,13 @@ def test_pub_kcdc_ili() -> None:
127
160
data = apicall .json (disable_date_parsing = True )
128
161
assert (len (data ) > 0 )
129
162
163
+ def test_pvt_meta_norostat () -> None :
164
+ apicall = Epidata .pvt_meta_norostat (
165
+ auth = auth
166
+ )
167
+ data = apicall .classic ()
168
+ assert (len (data ) > 0 )
169
+
130
170
def test_pub_meta () -> None :
131
171
apicall = Epidata .pub_meta ()
132
172
data = apicall .classic () # only supports classic
@@ -148,6 +188,15 @@ def test_pub_nidss_flu() -> None:
148
188
data = apicall .json (disable_date_parsing = True )
149
189
assert (len (data ) > 0 )
150
190
191
+ def test_pvt_norostat () -> None :
192
+ apicall = Epidata .pvt_norostat (
193
+ auth = auth ,
194
+ location = "1" ,
195
+ epiweeks = 201233
196
+ )
197
+ data = apicall .json ()
198
+ assert (len (data ) > 0 )
199
+
151
200
def test_pub_nowcast () -> None :
152
201
apicall = Epidata .pub_nowcast (
153
202
locations = "ca" ,
@@ -164,6 +213,35 @@ def test_pub_paho_dengue() -> None:
164
213
data = apicall .json (disable_date_parsing = True )
165
214
assert (len (data ) > 0 )
166
215
216
+ def test_pvt_quidel () -> None :
217
+ apicall = Epidata .pvt_quidel (
218
+ auth = auth ,
219
+ locations = "hhs1" ,
220
+ epiweeks = EpiRange (201201 , 202001 )
221
+ )
222
+ data = apicall .json ()
223
+ assert (len (data ) > 0 )
224
+
225
+ def test_pvt_sensors () -> None :
226
+ apicall = Epidata .pvt_sensors (
227
+ auth = auth ,
228
+ names = "sar3" ,
229
+ locations = "nat" ,
230
+ epiweeks = EpiRange (201501 , 202001 )
231
+ )
232
+ data = apicall .json ()
233
+ assert (len (data ) > 0 )
234
+
235
+ def test_pvt_twitter () -> None :
236
+ apicall = Epidata .pvt_twitter (
237
+ auth = auth ,
238
+ locations = "CA" ,
239
+ time_type = "week" ,
240
+ time_values = EpiRange (201501 , 202001 )
241
+ )
242
+ data = apicall .json ()
243
+ assert (len (data ) > 0 )
244
+
167
245
def test_pub_wiki () -> None :
168
246
apicall = Epidata .pub_wiki (
169
247
articles = "avian_influenza" ,
0 commit comments