-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Janik Zikovsky
committed
Dec 13, 2011
1 parent
3c65df2
commit d355ab5
Showing
2 changed files
with
61 additions
and
27 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
Code/Mantid/MantidQt/SliceViewer/test/SliceViewerPythonInterfaceTest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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_() |
27 changes: 0 additions & 27 deletions
27
Code/Mantid/MantidQt/SliceViewer/test/test_python_interface.py
This file was deleted.
Oops, something went wrong.