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")
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")
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)
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)