From e13d56f9060ca9126fbf15f24f75545858aaa5b7 Mon Sep 17 00:00:00 2001 From: Elliot Oram <elliot.oram@stfc.ac.uk> Date: Wed, 22 Nov 2017 10:21:26 +0000 Subject: [PATCH] Update Polaris system tests to use Mantid sytle validate Refs #21229 --- .../tests/analysis/ISIS_PowderPolarisTest.py | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py index 0d921c8d481..a4ecbf0f789 100644 --- a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py +++ b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py @@ -53,7 +53,9 @@ class CreateVanadiumTest(stresstesting.MantidStressTest): self.calibration_results = run_vanadium_calibration() def validate(self): - return calibration_validator(self.calibration_results) + splined_ws, unsplined_ws = self.calibration_results + return unsplined_ws.getName(), "ISIS_Powder-POLARIS00098533_unsplined.nxs", \ + splined_ws.getName(), "ISIS_Powder-POLARIS00098533_splined.nxs" def cleanup(self): try: @@ -78,7 +80,7 @@ class FocusTest(stresstesting.MantidStressTest): self.focus_results = run_focus() def validate(self): - return focus_validation(self.focus_results) + return self.focus_results.getName(), "ISIS_Powder-POLARIS98533_FocusSempty.nxs" def cleanup(self): try: @@ -134,33 +136,6 @@ def run_focus(): sample_empty_scale=sample_empty_scale) -def calibration_validator(results): - splined_ws, unsplined_ws = results - # Get the name of the grouped workspace list - splined_reference_file_name = "ISIS_Powder-POLARIS00098533_splined.nxs" - unsplined_reference_file_name = "ISIS_Powder-POLARIS00098533_unsplined.nxs" - return _compare_ws(reference_file_name=splined_reference_file_name, results=splined_ws) and \ - _compare_ws(reference_file_name=unsplined_reference_file_name, results=unsplined_ws) - - -def focus_validation(results): - reference_file_name = "ISIS_Powder-POLARIS98533_FocusSempty.nxs" - return _compare_ws(reference_file_name=reference_file_name, results=results) - - -def _compare_ws(reference_file_name, results): - ref_ws = mantid.Load(Filename=reference_file_name) - - is_valid = len(results) > 0 - - for ws, ref in zip(results, ref_ws): - if not (mantid.CompareWorkspaces(Workspace1=ws, Workspace2=ref)[0]): - is_valid = False - print (ws.getName() + " was not equal to: " + ref.getName()) - - return is_valid - - def setup_mantid_paths(): config['datasearch.directories'] += ";" + input_dir -- GitLab