def test_dot_invalid(self): # setup test_list = self._generate_random_list(row=3, col=4) test_mat = Matrix(test_list) # exercise and verify with self.assertRaises(ValueError): test_mat.dot(test_mat)
def test_dot_valid(self): # setup test_list = self._generate_random_list() test_mat = Matrix(test_list) np_mat = np.array(test_list) # exercise test_dot = test_mat.dot(test_mat.transpose()) np_dot = np_mat.dot(np_mat.transpose()) # verify self._compare_all_elements(test_dot, np_dot) self.assertEqual(test_dot.row, test_dot.col)