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