Пример #1
0
def test_verify():
    f = lambda x, n: len(x) > n
    df = pd.DataFrame({'A': [1, 2, 3]})
    tm.assert_frame_equal(df, ck.verify(df, f, n=2))
    tm.assert_frame_equal(df, ck.verify(df, f, 2))

    # order is verify_func, verif_kwargs, decorated_func
    tm.assert_frame_equal(df, dc.verify(f, n=2)(_noop)(df))
    tm.assert_frame_equal(df, dc.verify(f, 2)(_noop)(df))

    with pytest.raises(AssertionError):
        ck.verify(df, f, n=4)
        dc.verify(f, n=4)(_noop)(df)
Пример #2
0
def test_verify():
    f = lambda x, n: len(x) > n
    df = pd.DataFrame({'A': [1, 2, 3]})
    tm.assert_frame_equal(df, ck.verify(df, f, n=2))
    tm.assert_frame_equal(df, ck.verify(df, f, 2))

    # order is verify_func, verif_kwargs, decorated_func
    tm.assert_frame_equal(df, dc.verify(f, n=2)(_noop)(df))
    tm.assert_frame_equal(df, dc.verify(f, 2)(_noop)(df))

    with pytest.raises(AssertionError):
        ck.verify(df, f, n=4)
        dc.verify(f, n=4)(_noop)(df)