Ticket #1553: test.py

File test.py, 944 bytes (added by Anders Markvardsen, 10 years ago)
Line 
1from MantidFramework import *
2from mantidsimple import *
3mtd.initialise(False)
4import os 
5
6TEST_DIR = "../../../Test/Data/SANS2D/"
7filepath = os.path.join(TEST_DIR, "BioSANS_test_data.xml") 
8instrpath = "../../../Test/Instrument/BIOSANS_Definition.xml" 
9
10success = True 
11
12loader = LoadSpice2D(filepath, "test") 
13test1 = mtd['test'].getInstrument().getComponentByName("detector1").getPos().getZ()==6.0 
14test2 = mtd['test'].getInstrument().getStringParameter("detector-name")[0] == 'detector1' 
15
16LoadEmptyInstrument(instrpath, 'inst') 
17loader = LoadSpice2D(filepath, "test") 
18test3 = mtd['test'].getInstrument().getComponentByName("detector1").getPos().getZ()==6.0 
19test4 = len(mtd['test'].getInstrument().getStringParameter("detector-name")) == 1 
20test5 = mtd['inst'].getInstrument().getStringParameter("detector-name")[0] == 'detector1' 
21
22print "SUCCESS ? " 
23print test1
24print test2
25print test3
26print test4
27print test5
28