示例#1
0
 def test_odd_num(self):
     self.assertTrue(is_odd(3))
示例#2
0
 def test_is_even(self):
     self.assertFalse(is_odd(0))
示例#3
0
 def test_even_num(self):
     self.assertFalse(is_odd(2))
示例#4
0
 def test_zero(self):
     self.assertFalse(is_odd(0))
示例#5
0
 def test_neg_num(self):
     self.assertTrue(is_odd(-3))
示例#6
0
 def test_is_odd(self):
     self.assertTrue(is_odd(1))
     self.assertTrue(is_odd(1337))
     self.assertFalse(is_odd(2))
     self.assertFalse(is_odd(20))
     self.assertFalse(is_odd(0))
示例#7
0
 def test_throws_exception(self):
     with self.assertRaises(Exception):
       is_odd('hello')