Skip to content
Snippets Groups Projects
Commit e13d56f9 authored by Elliot Oram's avatar Elliot Oram
Browse files

Update Polaris system tests to use Mantid sytle validate

Refs #21229
parent 21416b71
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,9 @@ class CreateVanadiumTest(stresstesting.MantidStressTest): ...@@ -53,7 +53,9 @@ class CreateVanadiumTest(stresstesting.MantidStressTest):
self.calibration_results = run_vanadium_calibration() self.calibration_results = run_vanadium_calibration()
def validate(self): 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): def cleanup(self):
try: try:
...@@ -78,7 +80,7 @@ class FocusTest(stresstesting.MantidStressTest): ...@@ -78,7 +80,7 @@ class FocusTest(stresstesting.MantidStressTest):
self.focus_results = run_focus() self.focus_results = run_focus()
def validate(self): def validate(self):
return focus_validation(self.focus_results) return self.focus_results.getName(), "ISIS_Powder-POLARIS98533_FocusSempty.nxs"
def cleanup(self): def cleanup(self):
try: try:
...@@ -134,33 +136,6 @@ def run_focus(): ...@@ -134,33 +136,6 @@ def run_focus():
sample_empty_scale=sample_empty_scale) 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(): def setup_mantid_paths():
config['datasearch.directories'] += ";" + input_dir config['datasearch.directories'] += ";" + input_dir
......
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