def test_merge_construction(): s = stream("1") evt = event(V.foo == 1) >> event(V.bar == 2) span1 = span(s(evt), within=delta(days=1)) span2 = span(s(evt), within=delta(days=2)) assume(merge(span1, span2))
def test_simple_spans(query): s1 = stream("1") s2 = stream("2") sp1 = span(s1.foo == query, s2.foo == query) sp2 = span(s1.foo == query, s2.foo == query, within=delta(days=2)) assume(type(sp1) is Span) assume(type(sp2) is Span)
def test_serial_construction(query1, query2): s1 = stream("1") s2 = stream("2") evt1 = event(V.foo == query1) evt2 = event(V.foo == query2) srl = span(s1(evt1)) \ .then(s2(evt2), within=delta(days=5)) assume(type(srl) is Serial)