Example #1
0
 def test_check_not_none_with_none_msg(self):
     i = None
     m = "message"
     with self.assertRaises(NoneValueException) as context:
         Preconditions.check_not_none(i, m)
     self.assertTrue(m in str(context.exception))
Example #2
0
 def test_check_not_none_without_none_msg(self):
     i = 42
     r = Preconditions.check_not_none(i, "message")
     self.assertEqual(i, r)
Example #3
0
 def test_check_not_none_with_none_no_msg(self):
     i = None
     with self.assertRaises(NoneValueException) as context:
         Preconditions.check_not_none(i)
     self.assertTrue(isinstance(context.exception, NoneValueException))
Example #4
0
 def test_check_not_none_without_none_no_msg(self):
     i = 42
     self.assertEqual(i, Preconditions.check_not_none(i))