Ejemplo n.º 1
0
 def test5(self):
     """Test with valid inputs """
     m1 = [[1, 2, 3], [2, 3, 4]]
     self.assertEqual(matrix_add([[]], m1), None)
Ejemplo n.º 2
0
 def test4(self):
     """Test with invalid inputs """
     m1 = [[1, 2, 3], [2, 3, 4]]
     m3 = [[1, 2], [3, 4], [5, 6]]
     self.assertEqual(matrix_add(m1, m3), None)
Ejemplo n.º 3
0
 def test2(self):
     """Test with valid inputs """
     m1 = [[1, 2, 3], [2, 3, 4]]
     self.assertListEqual(matrix_add(m1, m1), [[2, 4, 6], [4, 6, 8]])
Ejemplo n.º 4
0
 def test3(self):
     """Test with valid inputs """
     self.assertListEqual(matrix_add([[]], [[]]), [[]])
Ejemplo n.º 5
0
 def test1(self):
     """Test with valid inputs """
     m1 = [[1, 2, 3], [2, 3, 4]]
     m2 = [[5, 6, 7], [8, 9, 10]]
     self.assertListEqual(matrix_add(m1, m2), [[6, 8, 10], [10, 12, 14]])