示例#1
0
def test_start(test_data):
    workout = Workout(test_data + '/basic.yml')
    workout.start()
    sleep(0.01)

    assert workout.current_interval() == workout.intervals[0]
    assert workout.elapsed() == approx_time(0.01)
示例#2
0
def test_pause(test_data):
    workout = Workout(yaml_file=test_data + '/basic.yml')
    workout.start()
    sleep(0.01)
    workout.pause()
    sleep(0.01)

    assert workout.state == WorkoutState.paused
    assert workout.elapsed() == approx_time(0.01)