Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
9fbb1cce
Commit
9fbb1cce
authored
6 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #24512 added calibration tests
parent
704735e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
+71
-5
71 additions, 5 deletions
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
with
71 additions
and
5 deletions
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
+
71
−
5
View file @
9fbb1cce
...
...
@@ -6,16 +6,26 @@
# SPDX - License - Identifier: GPL - 3.0 +
from
__future__
import
(
absolute_import
,
division
,
print_function
)
import
os
import
systemtesting
import
shutil
import
mantid.simpleapi
as
simple
from
mantid
import
config
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
):
os
.
makedirs
(
cal_directory
)
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
"
/home/sjenkins/Work/Build-1/ExternalData/Testing/Data/SystemTest
"
)
directory
=
cal_directory
)
test
.
create_vanadium
()
def
validate
(
self
):
...
...
@@ -23,19 +33,75 @@ class CreateVanadiumTest(systemtesting.MantidSystemTest):
def
cleanup
(
self
):
simple
.
mtd
.
clear
()
_try_delete
(
cal_directory
)
class
CreateCalibrationWholeTest
(
systemtesting
.
MantidSystemTest
):
def
runTest
(
self
):
os
.
makedirs
(
cal_directory
)
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
"
/home/sjenkins/Work/Build-1/ExternalData/Testing/Data/SystemTest
"
)
directory
=
cal_directory
)
test
.
create_vanadium
()
test
.
create_calibration
()
def
validate
(
self
):
return
(
"
eng_calib
"
,
"
engggui_calibration_sample.nxs
"
,
"
engg_calibration_bank_1
"
,
"
engggui_calibration_bank_1.nxs
"
,
"
engg_calibration_bank_2
"
,
"
engggui_calibration_bank_2.nxs
"
,)
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment