Sha256: 21073388f211ea58e16adad9efa790c0f939c67ec1734a8150e5d034982713e8

Contents?: true

Size: 1.05 KB

Versions: 73

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.2.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

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.179 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.178 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.177 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.176 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.175 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.174 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.173 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.172 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.171 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.170 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.169 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.167 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.166 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.165 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.164 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.163 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.162 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.161 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py
trackler-2.2.1.160 tracks/python/exercises/difference-of-squares/difference_of_squares_test.py