"Framework/git@code.ornl.gov:mantidproject/mantid.git" did not exist on "7fe9acd49698f1492a6c17b9d62265eb8cf954bd"
Newer
Older
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, division, print_function)
from Engineering.EnginX import EnginX
DIRS = config['datasearch.directories'].split(';')
root_directory = os.path.join(DIRS[0], "ENGINX")
cal_directory = os.path.join(root_directory, "cal")
focus_directory = os.path.join(root_directory, "focus")
focus_tests = 0
class CreateVanadiumTest(systemtesting.MantidSystemTest):
def runTest(self):
test = EnginX(user="test", vanadium_run="236516",
test.create_vanadium()
def validate(self):
return "eng_vanadium_integration", "engggui_vanadium_integration.nxs"
def cleanup(self):
simple.mtd.clear()
class CreateCalibrationWholeTest(systemtesting.MantidSystemTest):
test = EnginX(user="test", vanadium_run="236516",
directory=cal_directory)
test.create_vanadium()
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
return ("engg_calibration_bank_1", "engggui_calibration_bank_1.nxs",
"engg_calibration_bank_2", "engggui_calibration_bank_2.nxs",
"engg_calibration_banks_parameters", "engggui_calibration_banks_parameters.nxs")
def cleanup(self):
simple.mtd.clear()
_try_delete(cal_directory)
class CreateCalibrationCroppedTest(systemtesting.MantidSystemTest):
def runTest(self):
os.makedirs(cal_directory)
test = EnginX(user="test", vanadium_run="236516",
directory=cal_directory)
test.create_vanadium()
test.create_calibration(cropped="spectra", spectra="1-20")
def validate(self):
return ("cropped", "engggui_calibration_bank_cropped.nxs",
"engg_calibration_banks_parameters", "engggui_calibration_bank_cropped_parameters.nxs")
def cleanup(self):
simple.mtd.clear()
_try_delete(cal_directory)
class CreateCalibrationBankTest(systemtesting.MantidSystemTest):
def runTest(self):
os.makedirs(cal_directory)
test = EnginX(user="test", vanadium_run="236516",
directory=cal_directory)
test.create_vanadium()
test.create_calibration(cropped="banks", bank="South")
def validate(self):
return ("engg_calibration_bank_2", "engggui_calibration_bank_2.nxs",
"engg_calibration_banks_parameters", "engggui_calibration_bank_south_parameters.nxs")
def cleanup(self):
simple.mtd.clear()
_try_delete(cal_directory)
def _try_delete(path):
try:
# Use this instead of os.remove as we could be passed a non-empty dir
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
except OSError:
print ("Could not delete output file at: ", path)