def test_div(source, x): ts = TimeSeries("test", source) assert abs((ts / x).sum() - ts.sum() / x) < 0.001
def test_dist(): ts1 = TimeSeries('test', dates_perc) ts2 = TimeSeries('tost', dates_cut) assert ts1.sum() != ts2.sum() with pytest.raises(Exception): dist = ts1.dist(ts2)
def test_sum(source): ts = TimeSeries("test", source) assert ts.sum() == ts.vs.sum()