def test_instantiate(self): err_string = "foo is not a valid boolean type" with self.assertRaisesRegexp(AssertionError, err_string): BooleanType("foo") err_string = "None is not a valid boolean type" with self.assertRaisesRegexp(AssertionError, err_string): BooleanType(None)
def test_boolean_is_true_and_is_false(self): self.assertTrue(BooleanType(True).is_true()) self.assertFalse(BooleanType(True).is_false()) self.assertFalse(BooleanType(False).is_true()) self.assertTrue(BooleanType(False).is_false())