Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import sys
import sys
import os
import unittest
import time
# Import the Mantid framework
sys.path.append( os.getcwd() )
import MantidFramework
from MantidFramework import mtd
from mantidsimple import *
# Create a test data set
CreateMDWorkspace(Dimensions='3',Extents='0,10,0,10,0,10',Names='x,y,z',
Units='m,m,m',SplitInto='5',MaxRecursionDepth='20',OutputWorkspace='mdw')
FakeMDEventData("mdw", UniformParams="1e6")
BinMD("mdw", "uniform", AxisAligned=1, AlignedDimX="x,0,10,30", AlignedDimY="y,0,10,30", AlignedDimZ="z,0,10,30", IterateEvents="1", Parallel="0")
w = mtd['uniform']
print "CREATED!", w
from PyQt4 import Qt
import libmantidqtpython
class SliceViewerPythonInterfaceTest(unittest.TestCase):
"""Test for accessing SliceViewer widgets from MantidPlot
python interpreter"""
def setUp(self):
self.app = Qt.QApplication(sys.argv)
self.sv = libmantidqtpython.MantidQt.SliceViewer.SliceViewer()
pass
def test_creating(self):
print "test_creating"
import time
sv = self.sv
#sv.setWorkspace('mdw')
sv.show()
print sv
#sv.close()
def test_creating2(self):
print "test_creating2"
if __name__=="__main__":
unittest.main()
## ----- Create and run the unit test ----------------------
#sys.path.append("/home/8oz/Code/Mantid/Code/Mantid/TestingTools/unittest-xml-reporting/src")
#import xmlrunner
#suite = unittest.makeSuite(SliceViewerPythonInterfaceTest)
#runner = xmlrunner.XMLTestRunner(output='Testing')
#runner.run(suite)
#print "Done!"
#
## Run the app.
#a.exec_()