def test_verify_all(): f = lambda x, n: x > n df = pd.DataFrame({'A': [1, 2, 3]}) tm.assert_frame_equal(df, ck.verify_all(df, f, 0)) tm.assert_frame_equal(df, ck.verify_all(df, f, n=0)) with pytest.raises(AssertionError): ck.verify_all(df, f, n=2) dc.verify_all(f, n=2)(df)
def check_hourly_temp(htemp, dtemps): def check(df): r = (df.htmax <= df.dtmax | df.htmin >= df.dtmin) return r df = pd.DataFrame({ 'htmax': htemp.resample('D', how='max'), 'htmin': htemp.resample('D', how='min'), 'dtmax': dtemps.tmax, 'dtmin': dtemps.tmin }) ec.verify_all(df, check)