Example #1
0
 def test_imperfect_numbers(self):
     for imperfect_number in IMPERFECT_NUMBERS:
         self.assertFalse(
             solution.is_perfect(imperfect_number),
             "{} is expected to be an imperfect number".format(imperfect_number),
         )
Example #2
0
 def test_perfects(self):
     self.assertTrue(is_perfect(6))
     self.assertTrue(is_perfect(28))
     self.assertTrue(is_perfect(496))
     self.assertTrue(is_perfect(8128))
     self.assertTrue(is_perfect(33550336))
Example #3
0
 def test_perfect_numbers(self):
     for perfect_number in PERFECT_NUMBERS:
         self.assertTrue(
             solution.is_perfect(perfect_number), "{} is expected to be a perfect number".format(perfect_number)
         )
Example #4
0
 def test_not_perfect(self):
     self.assertFalse(is_perfect(0))
     self.assertFalse(is_perfect(1))
     self.assertFalse(is_perfect(10))
     self.assertFalse(is_perfect(3423))