Ejemplo n.º 1
0
def test_get_session_spans_empty():
    t1 = Timestamp.min
    t2 = Timestamp.max
    model = Model(StubDataStore.empty())

    result = model.get_session_spans(t1, t2)

    expected = make_spans([(t1, t2, INACTIVE)])
    assert_frame_equal(result, expected)
Ejemplo n.º 2
0
def test_get_session_spans_one_active_span():
    t1 = Timestamp(2018, 1, 1)
    t2 = Timestamp(2018, 1, 2)
    t3 = Timestamp(2018, 1, 3)
    model = Model(StubDataStore(session_events=[(t2, ACTIVE)], desk_events=[]))

    result = model.get_session_spans(t1, t3)

    expected = make_spans([(t1, t2, INACTIVE), (t2, t3, ACTIVE)])
    assert_frame_equal(result, expected)