(self)
| 38 | |
| 39 | class TestMatrixOperations(unittest.TestCase): |
| 40 | def test_matrix_addition(self): |
| 41 | X = [[12,7,3], |
| 42 | [4 ,5,6], |
| 43 | [7 ,8,9]] |
| 44 | |
| 45 | Y = [[5,8,1], |
| 46 | [6,7,3], |
| 47 | [4,5,9]] |
| 48 | |
| 49 | matrix = matrix_operations.Matrix(X, Y) |
| 50 | self.assertEqual(matrix.add(), [[17, 15, 4], [10, 12, 9], [11, 13, 18]]) |
| 51 | |
| 52 | |
| 53 | def test_matrix_subtraction(self): |