Beispiel #1
0
def test_claculate_average_speed_two_trips():
    driver = Driver("Dan")
    driver.add_trip(Trip.parse("07:15", "07:45", "17.3"))
    driver.add_trip(Trip.parse("06:12", "06:32", "21.8"))

    average_speed = driver.get_average_speed()
    average_speed.should.equal(46.92)
Beispiel #2
0
def test_claculate_average_speed_no_trips():
    driver = Driver("Dan")

    average_speed = driver.get_average_speed()
    average_speed.should.equal(0)
Beispiel #3
0
def test_calculate_average_speed_one_trip():
    driver = Driver("Dan")
    driver.add_trip(Trip.parse("07:15", "07:45", "17.3"))

    average_speed = driver.get_average_speed()
    average_speed.should.equal(34.6)