Exemple #1
0
 def test_boolean(self):
   # Python 2.x legacy. Ew.
   self.assertFalse(builtins.is_odd(False))
   self.assertTrue(builtins.is_odd(True))
Exemple #2
0
 def test_boolean(self):
   # Python 2.x legacy. Ew.
   self.assertFalse(is_odd(False))
   self.assertTrue(is_odd(True))
Exemple #3
0
 def test_parity(self):
   self.assertTrue(builtins.is_odd(1))
   self.assertFalse(builtins.is_odd(2))
   self.assertTrue(builtins.is_odd(-1))
   self.assertFalse(builtins.is_odd(-2))
   self.assertFalse(builtins.is_odd(0))
Exemple #4
0
 def test_parity(self):
   self.assertTrue(is_odd(1))
   self.assertFalse(is_odd(2))
   self.assertTrue(is_odd(-1))
   self.assertFalse(is_odd(-2))
   self.assertFalse(is_odd(0))