Esempio n. 1
0
 def test_random_matrix_creation(self):
     """Tests the creation of a matrix filled with random values"""
     matrix = multiply.random_matrix(6, 4)
     rows = len(matrix)
     cols = len(matrix[0])
     self.assertEqual(rows, 6)
     self.assertEqual(cols, 4)
Esempio n. 2
0
 def test_wrong_dimensions(self):
     """Test if an exception is raised when matrices cannot be multiplied"""
     m1 = multiply.random_matrix(2, 3)
     m2 = multiply.random_matrix(4, 1)
     self.assertRaises(ValueError, multiply.multiply, m1, m2)