Sha256: 6721a3befadbb9486e24bde8eba5372bcc36ab1218b825fe7531cc49cb0bab33

Contents?: true

Size: 1.06 KB

Versions: 26

Compression:

Stored size: 1.06 KB

Contents

import unittest

from perfect_numbers import is_perfect


class PerfectNumbersTest(unittest.TestCase):

    def test_first_perfect_number(self):
        self.assertTrue(is_perfect(6))

    def test_no_perfect_number(self):
        self.assertFalse(is_perfect(8))

    def test_second_perfect_number(self):
        self.assertTrue(is_perfect(28))

    def test_abundant(self):
        self.assertFalse(is_perfect(20))

    def test_answer_to_the_ultimate_question_of_life(self):
        self.assertFalse(is_perfect(42))

    def test_third_perfect_number(self):
        self.assertTrue(is_perfect(496))

    def test_odd_abundant(self):
        self.assertFalse(is_perfect(945))

    def test_fourth_perfect_number(self):
        self.assertTrue(is_perfect(8128))

    def test_fifth_perfect_number(self):
        self.assertTrue(is_perfect(33550336))

    def test_sixth_perfect_number(self):
        self.assertTrue(is_perfect(8589869056))

    def test_seventh_perfect_number(self):
        self.assertTrue(is_perfect(137438691328))

if __name__ == '__main__':
    unittest.main()

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
trackler-2.0.3.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.2.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.1.2 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.1.1 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.1.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.10 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.9 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.8 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.7 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.6 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.5 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.4 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.3 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.2 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.1 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-2.0.0.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-1.0.4.1 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-1.0.4.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-1.0.3.0 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py
trackler-1.0.2.1 tracks/python/exercises/perfect-numbers/perfect_numbers_test.py