Skip to content
Snippets Groups Projects
Commit 189d97f7 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Refs #11355 Transfer truncate extents test

parent 1574effe
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,32 @@ public:
AnalysisDataService::Instance().remove(wsName);
}
void test_truncate_extents() {
const std::string wsName = "__CutMDTest_truncate_extents";
auto algCutMD = FrameworkManager::Instance().createAlgorithm("CutMD");
algCutMD->initialize();
algCutMD->setRethrows(true);
algCutMD->setProperty("InputWorkspace", sharedWSName);
algCutMD->setProperty("OutputWorkspace", wsName);
algCutMD->setProperty("P1Bin", "0,1.1,1");
algCutMD->setProperty("P2Bin", "21");
algCutMD->setProperty("P3Bin", "0.1");
algCutMD->setProperty("CheckAxes", false);
algCutMD->setProperty("NoPix", true);
algCutMD->execute();
TS_ASSERT(algCutMD->isExecuted());
IMDWorkspace_sptr outWS =
AnalysisDataService::Instance().retrieveWS<IMDWorkspace>(wsName);
TS_ASSERT(outWS.get());
TS_ASSERT_EQUALS(outWS->getDimension(0)->getNBins(), 1);
TS_ASSERT_EQUALS(outWS->getDimension(1)->getNBins(), 1);
AnalysisDataService::Instance().remove(wsName);
}
};
#endif /* MANTID_MDALGORITHMS_CUTMDTEST_H_ */
......@@ -22,12 +22,6 @@ class CutMDTest(unittest.TestCase):
def tearDown(self):
DeleteWorkspace(self.__in_md )
def test_truncate_extents(self):
out_md = CutMD(self.__in_md, P1Bin=[0, 1.1, 1], P2Bin=[21], P3Bin=[0.1], CheckAxes=False, NoPix=True)
self.assertEqual(1, out_md.getDimension(0).getNBins(), "Step is beyond range. Should just be integrated")
self.assertEqual(1, out_md.getDimension(1).getNBins(), "Step is beyond range. Should just be integrated")
def test_wrong_projection_workspace_format_wrong_column_numbers(self):
projection = CreateEmptyTableWorkspace()
projection.addColumn("str", "name")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment