예제 #1
0
 def test_check_state_false_no_msg(self):
     with self.assertRaises(IllegalStateException) as context:
         Preconditions.check_state(False)
     self.assertTrue(isinstance(context.exception, IllegalStateException))
예제 #2
0
 def test_check_state_false_msg(self):
     m = "message"
     with self.assertRaises(IllegalStateException) as context:
         Preconditions.check_state(False, m)
     self.assertTrue(m in str(context.exception))
예제 #3
0
 def test_check_state_true_msg(self):
     try:
         Preconditions.check_state(True, "message")
     except IllegalStateException:  # pragma: no cover
         self.fail("check_state() raised IllegalStateException "
                   "unexpectedly!")  # pragma: no cover