From 189d97f7906b4856fb10a6992f868ad7c3257db3 Mon Sep 17 00:00:00 2001
From: Harry Jeffery <henry.jeffery@stfc.ac.uk>
Date: Mon, 30 Mar 2015 14:15:13 +0100
Subject: [PATCH] Refs #11355 Transfer truncate extents test

---
 .../Framework/MDAlgorithms/test/CutMDTest.h   | 26 +++++++++++++++++++
 .../test/python/mantid/api/CutMDTest.py       |  6 -----
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
index 46ac4722666..d516aa97fe8 100644
--- a/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
+++ b/Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
@@ -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_ */
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 a758ef66d25..395578cbfba 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py
@@ -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")
-- 
GitLab