예제 #1
0
파일: test_check.py 프로젝트: si618/pi-time
 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")
예제 #2
0
 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")
예제 #3
0
파일: test_check.py 프로젝트: si618/pi-time
 def test_check_timezone_passes_when_timezone_is_valid(self):
     # Arrange
     laptimer = json.loads('{"timezone": "Australia/Adelaide"}')
     # Act & Assert
     check.check_timezone(laptimer)
예제 #4
0
 def test_check_timezone_passes_when_timezone_is_valid(self):
     # Arrange
     laptimer = json.loads('{"timezone": "Australia/Adelaide"}')
     # Act & Assert
     check.check_timezone(laptimer)