Beispiel #1
0
def test_ending(test_data):
    workout = Workout(yaml_file=test_data + '/quick.yml')
    workout.start()
    sleep(0.03)

    workout.progress()

    assert workout.state == WorkoutState.stopped
Beispiel #2
0
def test_progress(test_data):
    workout = Workout(yaml_file=test_data + '/quick.yml')
    workout.start()
    sleep(0.01)

    progress = workout.progress()

    assert progress.elapsed == approx_time(0.01)
    assert progress.remaining == approx_time(0.02)
    assert progress.interval_elapsed == approx_time(0.)
    assert progress.interval_remaining == approx_time(0.01)
    assert progress.interval == workout.intervals[1]
    assert progress.changed_interval is True

    progress = workout.progress()

    assert progress.changed_interval is False
Beispiel #3
0
def test_transition(test_data):
    workout = Workout(yaml_file=test_data + '/quick.yml')
    workout.start()
    sleep(0.01)

    progress = workout.progress()

    assert workout.current_interval() == workout.intervals[1]
    assert progress.changed_interval