Пример #1
0
def test_split():
    '''
    Trivial test assuming the actual split is done by data_frame.split_array_like
    '''
    actual = series_.split(pd.Series([[1,2],[2,3,4],[]]))
    expected = pd.Series([1,2,2,3,4])
    series_.assert_equals(actual, expected, ignore_index=True)
    
Пример #2
0
def test_assert_equals():
    '''
    Trivial test assuming the actual equality check is forwarded to
    series.equals
    '''
    series1 = pd.Series([1, 2, 3], index=['i1', 'i2', 'i3'])
    series_.assert_equals(series1, series1)
    
    series2 = pd.Series([2, 1, 3+1e-8], index=[1,2,3])
    series_.assert_equals(series1, series2, ignore_order=True, ignore_index=True, all_close=True)
    with pytest.raises(AssertionError):
        series_.assert_equals(series1, series2, ignore_index=True, all_close=True)