diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h index d516aa97fe862ac52188f79a51be8bac7e48cbed..0e793fc2f47e8245d85757b00ea172809df82e12 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h @@ -189,6 +189,25 @@ public: AnalysisDataService::Instance().remove(wsName); } + + void test_wrong_proj_format_columns() { + const std::string wsName = "__CutMDTest_wrong_proj_columns"; + + ITableWorkspace_sptr proj = WorkspaceFactory::Instance().createTable(); + proj->addColumn("str", "name"); + + auto algCutMD = FrameworkManager::Instance().createAlgorithm("CutMD"); + algCutMD->initialize(); + algCutMD->setRethrows(true); + algCutMD->setProperty("InputWorkspace", sharedWSName); + algCutMD->setProperty("OutputWorkspace", wsName); + algCutMD->setProperty("Projection", proj); + algCutMD->setProperty("P1Bin", "0.1"); + algCutMD->setProperty("P2Bin", "0.2"); + algCutMD->setProperty("P3Bin", "0.1"); + algCutMD->setProperty("CheckAxes", false); + TS_ASSERT_THROWS(algCutMD->execute(), std::runtime_error); + } }; #endif /* MANTID_MDALGORITHMS_CUTMDTEST_H_ */ diff --git a/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py b/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py index 395578cbfba055934e4867a60f8d8905029cc400..f0d887d8aabe75a332eb981a568944df2dcdb722 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py +++ b/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py @@ -21,12 +21,6 @@ class CutMDTest(unittest.TestCase): def tearDown(self): DeleteWorkspace(self.__in_md ) - - def test_wrong_projection_workspace_format_wrong_column_numbers(self): - projection = CreateEmptyTableWorkspace() - projection.addColumn("str", "name") - # missing other columns - self.assertRaises(RuntimeError, CutMD, InputWorkspace=self.__in_md, Projection=projection, OutputWorkspace="out_ws", P1Bin=[0.1], P2Bin=[0.1], P3Bin=[0.1], CheckAxes=False) def test_wrong_table_workspace_format_wrong_row_numbers(self): projection = CreateEmptyTableWorkspace()