예제 #1
0
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)
예제 #2
0
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'])
예제 #3
0
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'])
예제 #4
0
def test_inseason():
    output = get_knmi_data('daily',
                           stations=[209],
                           start=20150101,
                           end=20170105,
                           inseason=True)
    output_comparison(output, test_data['inseason'])
예제 #5
0
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'])
예제 #6
0
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'])
예제 #7
0
def test_hourly_integer():
    output = get_knmi_data('hourly',
                           stations=[209],
                           start=2017010101,
                           end=2017010524)
    output_comparison(output, test_data['hourly'])
예제 #8
0
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)
예제 #9
0
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)
예제 #10
0
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'])
예제 #11
0
def test_gkd_single_station():
    output = get_knmi_data('daily',
                           stations=[209],
                           start=20170101,
                           end=20170105)
    output_comparison(output, test_data['daily_single_station'])
예제 #12
0
def test_gkd_empty():
    with pytest.raises(TypeError):
        get_knmi_data()