Esempio n. 1
0
 def test_check_unit_of_measurement_raises_exception_when_unit_is_invalid(self):
     # Arrange
     laptimer = json.loads('{"unitOfMeasurement": "bogus"}')
     # Act
     with self.assertRaises(Exception) as context:
         check.check_unit_of_measurement(laptimer)
     # Assert
     self.assertEqual(context.exception.message,
                      "'unitOfMeasurement' in laptimer configuration must be "
                      "('METRIC', 'IMPERIAL'), but got bogus")
Esempio n. 2
0
 def test_check_unit_of_measurement_raises_exception_when_unit_is_invalid(
         self):
     # Arrange
     laptimer = json.loads('{"unitOfMeasurement": "bogus"}')
     # Act
     with self.assertRaises(Exception) as context:
         check.check_unit_of_measurement(laptimer)
     # Assert
     self.assertEqual(
         context.exception.message,
         "'unitOfMeasurement' in laptimer configuration must be "
         "('METRIC', 'IMPERIAL'), but got bogus")
Esempio n. 3
0
 def test_check_unit_of_measurement_passes_when_unit_is_valid(self):
     # Arrange
     laptimer = json.loads('{"unitOfMeasurement": "%s"}' % settings.METRIC)
     # Act & Assert
     check.check_unit_of_measurement(laptimer)
Esempio n. 4
0
 def test_check_unit_of_measurement_passes_when_unit_is_valid(self):
     # Arrange
     laptimer = json.loads('{"unitOfMeasurement": "%s"}' % settings.METRIC)
     # Act & Assert
     check.check_unit_of_measurement(laptimer)