Sha256: 3e4687607a17243d679261176d20ae9597af5dca6f6847b4d5bc4163733cac00

Contents?: true

Size: 967 Bytes

Versions: 196

Compression:

Stored size: 967 Bytes

Contents

import unittest

from matrix import Matrix


class MatrixTest(unittest.TestCase):
    def test_extract_a_row(self):
        matrix = Matrix("1 2\n10 20")
        self.assertEqual(matrix.rows[0], [1, 2])

    def test_extract_same_row_again(self):
        matrix = Matrix("9 7\n8 6")
        self.assertEqual(matrix.rows[0], [9, 7])

    def test_extract_other_row(self):
        matrix = Matrix("9 8 7\n19 18 17")
        self.assertEqual(matrix.rows[1], [19, 18, 17])

    def test_extract_other_row_again(self):
        matrix = Matrix("1 4 9\n16 25 36")
        self.assertEqual(matrix.rows[1], [16, 25, 36])

    def test_extract_a_column(self):
        matrix = Matrix("1 2 3\n4 5 6\n7 8 9\n8 7 6")
        self.assertEqual(matrix.columns[0], [1, 4, 7, 8])

    def test_extract_another_column(self):
        matrix = Matrix("89 1903 3\n18 3 1\n9 4 800")
        self.assertEqual(matrix.columns[1], [1903, 3, 4])


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

Version data entries

196 entries across 196 versions & 1 rubygems

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