def test_delete_zero_row_and_zero_col_in_matrix(self): test_matrix = Matrix.delete_col_and_row( Matrix.make_from_list([[1, 3], [5, 7]]), 0, 0) det = test_matrix.calculate_det() self.assertEqual(det, 7)
def test_can_calculate_minor_0_1(self): test_matrix = Matrix.delete_col_and_row( Matrix.make_from_list([[1, 0, -3], [0, 0, 2], [-1, -2, 0]]), 0, 1) det = test_matrix.calculate_det() self.assertEqual(det, 2)
def test_can_not_delete_incorrect_col_or_row(self): test_matrix = Matrix.make_from_list([[1, 3], [5, 7], [5, 7]]) with self.assertRaises(MatrixError): Matrix.delete_col_and_row(test_matrix, -100, -500)