diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h index 0e793fc2f47e8245d85757b00ea172809df82e12..1f50a8904795e68eb1e2ab49daf52ce6f04a9fcb 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h @@ -208,6 +208,30 @@ public: algCutMD->setProperty("CheckAxes", false); TS_ASSERT_THROWS(algCutMD->execute(), std::runtime_error); } + + void test_wrong_proj_format_rows() { + const std::string wsName = "__CutMDTest_wrong_proj_rows"; + + // Correct columns + ITableWorkspace_sptr proj = WorkspaceFactory::Instance().createTable(); + proj->addColumn("str", "name"); + proj->addColumn("str", "value"); + proj->addColumn("double", "offset"); + proj->addColumn("str", "type"); + // ...but no rows + + 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 f0d887d8aabe75a332eb981a568944df2dcdb722..004021beea6d4ff5de672405960bbbd19e6bec0e 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py +++ b/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py @@ -22,16 +22,6 @@ class CutMDTest(unittest.TestCase): def tearDown(self): DeleteWorkspace(self.__in_md ) - def test_wrong_table_workspace_format_wrong_row_numbers(self): - projection = CreateEmptyTableWorkspace() - # Correct number of columns, and names - projection.addColumn("str", "name") - projection.addColumn("str", "value") - projection.addColumn("double", "offset") - projection.addColumn("str", "type") - # Incorrect number of rows i.e. zero in this case as none added. - 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_orthogonal_slice_with_scaling(self): # We create a fake workspace and check to see that the extents get scaled with the new coordinate system when sliced to_cut = CreateMDWorkspace(Dimensions=3, Extents=[-1,1,-1,1,-1,1], Names='H,K,L', Units='U,U,U')