def test_integer_validation_hourly(): with pytest.raises(ValueError): get_knmi_data('hourly', stations=[209], start=20170101, end=2017010524) with pytest.raises(ValueError): get_knmi_data('hourly', stations=[209], start=2017010101, end=20170105241)
def test_gkd_multiple_vars(): output = get_knmi_data('daily', stations=[209], start=20170101, end=20170105, variables=['WIND', 'VICL']) output_comparison(output, test_data['daily_multiple_vars'])
def test_gkd_single_var(): output = get_knmi_data('daily', stations=[209], start=20170101, end=20170105, variables=['WIND']) output_comparison(output, test_data['daily_single_var'])
def test_inseason(): output = get_knmi_data('daily', stations=[209], start=20150101, end=20170105, inseason=True) output_comparison(output, test_data['inseason'])
def test_hourly_datetime(): datetime_start = datetime.datetime(2017, 1, 1, 0, 0) datetime_end = datetime.datetime(2017, 1, 5, 23, 59, 59) output = get_knmi_data('hourly', stations=[209], start=datetime_start, end=datetime_end) output_comparison(output, test_data['hourly'])
def test_datetime_date_daily(): date_start = datetime.date(2017, 1, 1) date_end = datetime.date(2017, 1, 5) output = get_knmi_data('daily', stations=[209], start=date_start, end=date_end) output_comparison(output, test_data['daily_single_station'])
def test_hourly_integer(): output = get_knmi_data('hourly', stations=[209], start=2017010101, end=2017010524) output_comparison(output, test_data['hourly'])
def test_datetime_validation_hourly_(): date_start = datetime.date(2017, 1, 1) date_end = datetime.date(2017, 1, 5) with pytest.raises(ValueError): get_knmi_data('hourly', stations=[209], start=date_start, end=date_end)
def test_datetime_integer_validation_daily(): with pytest.raises(ValueError): get_knmi_data('daily', stations=[209], start=201701, end=20170105) with pytest.raises(ValueError): get_knmi_data('daily', stations=[209], start=20170101, end=201701052)
def test_gkd_multiple_stations(): output = get_knmi_data('daily', stations=[209, 235], start=20170101, end=20170105) output_comparison(output, test_data['daily_multiple_stations'])
def test_gkd_single_station(): output = get_knmi_data('daily', stations=[209], start=20170101, end=20170105) output_comparison(output, test_data['daily_single_station'])
def test_gkd_empty(): with pytest.raises(TypeError): get_knmi_data()