Sha256: 0453d849d7df93fe26d13cb8f1c14b8b292759b4bee5549bd9308868513f394b

Contents?: true

Size: 1.05 KB

Versions: 60

Compression:

Stored size: 1.05 KB

Contents

import unittest

from difference_of_squares import difference, square_of_sum, sum_of_squares


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0

class DifferenceOfSquaresTest(unittest.TestCase):
    def test_square_of_sum_1(self):
        self.assertEqual(square_of_sum(1), 1)

    def test_square_of_sum_5(self):
        self.assertEqual(square_of_sum(5), 225)

    def test_square_of_sum_100(self):
        self.assertEqual(square_of_sum(100), 25502500)

    def test_sum_of_squares_1(self):
        self.assertEqual(sum_of_squares(1), 1)

    def test_sum_of_squares_5(self):
        self.assertEqual(sum_of_squares(5), 55)

    def test_sum_of_squares_100(self):
        self.assertEqual(sum_of_squares(100), 338350)

    def test_difference_of_squares_1(self):
        self.assertEqual(difference(1), 0)

    def test_difference_of_squares_5(self):
        self.assertEqual(difference(5), 170)

    def test_difference_of_squares_100(self):
        self.assertEqual(difference(100), 25164150)


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

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
trackler-2.2.1.105 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.104 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.103 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.102 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.101 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.100 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.99 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.98 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.97 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.96 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.95 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.94 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.93 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.92 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.91 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.90 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.89 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.88 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.87 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.86 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py