|
11 | 11 | get_info, |
12 | 12 | get_iv, |
13 | 13 | get_pmcodes, |
14 | | - get_qwdata, |
15 | 14 | get_ratings, |
16 | 15 | get_record, |
17 | 16 | get_stats, |
@@ -203,65 +202,6 @@ def test_get_info(requests_mock): |
203 | 202 | assert_metadata(requests_mock, request_url, md, site, [parameter_cd], format) |
204 | 203 |
|
205 | 204 |
|
206 | | -def test_get_qwdata(requests_mock): |
207 | | - """Tests get_qwdata method correctly generates the request url and returns |
208 | | - the result in a DataFrame""" |
209 | | - format = "rdb" |
210 | | - site = "01491000%2C01645000" |
211 | | - request_url = ( |
212 | | - "https://nwis.waterdata.usgs.gov/nwis/qwdata?site_no={}" |
213 | | - "&qw_sample_wide=qw_sample_wide&agency_cd=USGS&format={}&pm_cd_compare=Greater+than" |
214 | | - "&inventory_output=0&rdb_inventory_output=file&TZoutput=0&rdb_qw_attributes=expanded" |
215 | | - "&date_format=YYYY-MM-DD&rdb_compression=value&submitted_form=brief_list".format( |
216 | | - site, format |
217 | | - ) |
218 | | - ) |
219 | | - response_file_path = "data/waterdata_qwdata.txt" |
220 | | - mock_request(requests_mock, request_url, response_file_path) |
221 | | - with pytest.warns(DeprecationWarning): |
222 | | - df, md = get_qwdata(sites=["01491000", "01645000"]) |
223 | | - if not isinstance(df, DataFrame): |
224 | | - raise AssertionError(f"{type(df)} is not DataFrame base class type") |
225 | | - |
226 | | - if "geometry" in list(df): |
227 | | - if not isinstance(df, gpd.GeoDataFrame): |
228 | | - raise AssertionError(f"{type(df)} is not a GeoDataFrame") |
229 | | - |
230 | | - geom_type = df.geom_type.unique() |
231 | | - if len(geom_type) > 1 or geom_type[0] != "Point": |
232 | | - raise AssertionError( |
233 | | - f"Geometry type {geom_type} not valid, expecting Point" |
234 | | - ) |
235 | | - |
236 | | - assert df.size == 1821472 |
237 | | - assert_metadata(requests_mock, request_url, md, site, None, format) |
238 | | - |
239 | | - |
240 | | -@pytest.mark.parametrize("site_input_type_list", [True, False]) |
241 | | -def test_get_qwdata_site_value_types(requests_mock, site_input_type_list): |
242 | | - """Tests get_qwdata method for valid input types for the 'sites' parameter""" |
243 | | - _format = "rdb" |
244 | | - site = "01491000" |
245 | | - request_url = ( |
246 | | - "https://nwis.waterdata.usgs.gov/nwis/qwdata?site_no={}" |
247 | | - "&qw_sample_wide=qw_sample_wide&agency_cd=USGS&format={}&pm_cd_compare=Greater+than" |
248 | | - "&inventory_output=0&rdb_inventory_output=file&TZoutput=0&rdb_qw_attributes=expanded" |
249 | | - "&date_format=YYYY-MM-DD&rdb_compression=value&submitted_form=brief_list".format( |
250 | | - site, _format |
251 | | - ) |
252 | | - ) |
253 | | - response_file_path = "data/waterdata_qwdata.txt" |
254 | | - mock_request(requests_mock, request_url, response_file_path) |
255 | | - if site_input_type_list: |
256 | | - sites = [site] |
257 | | - else: |
258 | | - sites = site |
259 | | - with pytest.warns(DeprecationWarning): |
260 | | - df, md = get_qwdata(sites=sites) |
261 | | - assert type(df) is DataFrame |
262 | | - assert df.size == 1821472 |
263 | | - |
264 | | - |
265 | 205 | def test_get_gwlevels(requests_mock): |
266 | 206 | """Tests get_gwlevels method correctly generates the request url and returns the result in a DataFrame.""" |
267 | 207 | format = "rdb" |
|
0 commit comments