def test_check_timezone_raises_exception_when_timezone_is_invalid(self): # Arrange laptimer = json.loads('{"timezone": "bogus"}') # Act with self.assertRaises(Exception) as context: check.check_timezone(laptimer) # Assert self.assertEqual(context.exception.message, "'timezone' in laptimer configuration must be valid timezone, " "but got bogus")
def test_check_timezone_raises_exception_when_timezone_is_invalid(self): # Arrange laptimer = json.loads('{"timezone": "bogus"}') # Act with self.assertRaises(Exception) as context: check.check_timezone(laptimer) # Assert self.assertEqual( context.exception.message, "'timezone' in laptimer configuration must be valid timezone, " "but got bogus")
def test_check_timezone_passes_when_timezone_is_valid(self): # Arrange laptimer = json.loads('{"timezone": "Australia/Adelaide"}') # Act & Assert check.check_timezone(laptimer)