ReflectometryISISPreprocessTest.py 1.52 KB
Newer Older
1
2
3
4
5
6
7
8
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
#   NScD Oak Ridge National Laboratory, European Spallation Source,
#   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
import unittest

9
10
from mantid.api import IEventWorkspace, MatrixWorkspace
from mantid.simpleapi import ReflectometryISISPreprocess
11
12


13
14
15
16
17
18
19
class ReflectometryISISPreprocessTest(unittest.TestCase):
    def test_input_run_is_loaded_histo_mode_by_default(self):
        args = {'InputRunList': '13460',
                "OutputWorkspace": "ws"}
        output_ws = ReflectometryISISPreprocess(**args)
        self.assertIsInstance(output_ws, MatrixWorkspace)
        self.assertEqual("Workspace2D", output_ws.id())
20

21
22
23
24
25
26
27
    def test_input_run_is_loaded_histo_mode(self):
        args = {'InputRunList': '13460',
                "EventMode": False,
                "OutputWorkspace": "ws"}
        output_ws = ReflectometryISISPreprocess(**args)
        self.assertIsInstance(output_ws, MatrixWorkspace)
        self.assertEqual("Workspace2D", output_ws.id())
28

29
30
31
32
33
34
35
36
37
    def test_input_run_is_loaded_event_mode(self):
        args = {'InputRunList': '13460',
                "EventMode": True,
                "OutputWorkspace": "ws"}
        output_ws = ReflectometryISISPreprocess(**args)
        self.assertIsInstance(output_ws, IEventWorkspace)

    def test_validation_of_event_workspaces(self):
        pass
38
39
40
41


if __name__ == '__main__':
    unittest.main()