def test_true_when_10(self):
     self.assertTrue(happy(10))
 def test_true_when_97(self):
     self.assertTrue(happy(97))
 def test_false_when_4(self):
     self.assertFalse(happy(4))
Пример #4
0
 def test_happy_all(self):
     self.assertTrue(all(happy(n) for n in [10, 13, 203, 2003]))
Пример #5
0
 def test_happy_1(self):
     self.assertEqual(True, happy(1))
Пример #6
0
 def test_not_happy_all(self):
     self.assertFalse(all(happy(n) for n in [2, 3, 12, 77, 2004]))