예제 #1
0
 def test_average_speed_per_hour_returns_none_when_no_finish(self):
     # Arrange
     start = timezone.now()
     # Act
     avg_sph = compute.average_speed_per_hour(start, None, 10)
     # Assert
     self.assertEqual(None, avg_sph)
예제 #2
0
 def test_average_speed_per_hour_returns_none_when_no_finish(self):
     # Arrange
     start = timezone.now()
     # Act
     avg_sph = compute.average_speed_per_hour(start, None, 10)
     # Assert
     self.assertEqual(None, avg_sph)
예제 #3
0
 def test_average_speed_per_hour_returns_metric_result(self):
     # Arrange
     django_settings.set('String', 'unit_of_measurement', settings.METRIC)
     start = timezone.now()
     finish = start + datetime.timedelta(seconds=15)
     # Act
     avg_sph = compute.average_speed_per_hour(start, finish, 50)
     # Assert
     self.assertEqual(12, avg_sph)
예제 #4
0
 def test_average_speed_per_hour_returns_metric_result(self):
     # Arrange
     django_settings.set('String', 'unit_of_measurement', settings.METRIC)
     start = timezone.now()
     finish = start + datetime.timedelta(seconds=15)
     # Act
     avg_sph = compute.average_speed_per_hour(start, finish, 50)
     # Assert
     self.assertEqual(12, avg_sph)