示例#1
0
def test_adjust_slope_offset_arg_wndspd_series_str():
    # check error msg if a string is an element in the pandas DataFrame
    with pytest.raises(TypeError) as except_info:
        bw.adjust_slope_offset(pd.Series([2, 3, '4', 5]), current_slope,
                               current_offset, new_slope, new_offset)
    assert str(except_info.value
               ) == "some values in the Series are not of data type number"
示例#2
0
def test_adjust_slope_offset_arg_str():
    # check error msg if a string is sent as one of the slope or offset arguments
    with pytest.raises(TypeError) as except_info:
        bw.adjust_slope_offset(wndspd, current_slope, current_offset, '0.046',
                               new_offset)
    assert str(
        except_info.value) == "argument '0.046' is not of data type number"
示例#3
0
def test_adjust_slope_offset_arg_wndspd_list():
    # check error msg if a list is sent as the wind speed argument
    with pytest.raises(TypeError) as except_info:
        bw.adjust_slope_offset([2, 3, 4, 5], current_slope, current_offset,
                               new_slope, new_offset)
    assert str(except_info.value) == "wspd argument is not of data type number"
示例#4
0
def test_adjust_slope_offset_series():
    assert wndspd_adj_series.equals(
        bw.adjust_slope_offset(wndspd_series, current_slope, current_offset,
                               new_slope, new_offset))
示例#5
0
def test_adjust_slope_offset_df():
    assert wndspd_adj_df.equals(
        bw.adjust_slope_offset(wndspd_df, current_slope, current_offset,
                               new_slope, new_offset))
示例#6
0
def test_adjust_slope_offset_single_value():
    assert wndspd_adj == bw.adjust_slope_offset(wndspd, current_slope,
                                                current_offset, new_slope,
                                                new_offset)