Ejemplo n.º 1
0
 def test_check_sensor_location_raises_exception_when_location_is_invalid(self):
     # Arrange
     sensor = json.loads('{"location": "bogus"}')
     # Act
     with self.assertRaises(Exception) as context:
         check.check_sensor_location(sensor)
     # Assert
     self.assertEqual(context.exception.message,
                      "'location' in sensor configuration must be "
                      "('START', 'FINISH', 'START_FINISH', 'SECTOR'), "
                      "but got bogus")
Ejemplo n.º 2
0
 def test_check_sensor_location_raises_exception_when_location_is_invalid(
         self):
     # Arrange
     sensor = json.loads('{"location": "bogus"}')
     # Act
     with self.assertRaises(Exception) as context:
         check.check_sensor_location(sensor)
     # Assert
     self.assertEqual(
         context.exception.message,
         "'location' in sensor configuration must be "
         "('START', 'FINISH', 'START_FINISH', 'SECTOR'), "
         "but got bogus")
Ejemplo n.º 3
0
 def test_check_sensor_location_passes_when_location_is_valid(self):
     # Arrange
     sensor = json.loads('{"location": "%s"}' %
                         settings.SENSOR_LOCATION_START)
     # Act & Assert
     check.check_sensor_location(sensor)
Ejemplo n.º 4
0
 def test_check_sensor_location_passes_when_location_is_valid(self):
     # Arrange
     sensor = json.loads('{"location": "%s"}' %
                         settings.SENSOR_LOCATION_START)
     # Act & Assert
     check.check_sensor_location(sensor)