Esempio n. 1
0
def test_interval_durration():
    interval = Interval()
    interval.begin()
    sleep(1.1)
    interval.expire()
    assert interval.durration_calc() == 1
Esempio n. 2
0
def test_interval_expire_before_begin():
    interval = Interval()
    with pytest.raises(ValueError):
        interval.expire()
Esempio n. 3
0
def test_interval_begin_a_completed_process():
    interval = Interval()
    interval.begin()
    interval.expire()
    with pytest.raises(ValueError):
        interval.begin()
Esempio n. 4
0
def test_interval_status_complete():
    interval = Interval()
    interval.begin()
    interval.expire()
    assert interval.status == interval_states["COMPLETE"]