/[ascend]/trunk/test.py
ViewVC logotype

Annotation of /trunk/test.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 938 - (hide annotations) (download) (as text)
Fri Nov 24 06:09:46 2006 UTC (13 years ago) by johnpye
Original Path: trunk/pygtk/test.py
File MIME type: text/x-python
File size: 1155 byte(s)
Added support for dmalloc (http://dmalloc.com)
Added Integrator::setEngine(string name)
Minor other stuff.
1 johnpye 669 import unittest
2 johnpye 938 import ascpy
3 johnpye 669
4     class AscendTest(unittest.TestCase):
5    
6 johnpye 933 def setUp(self):
7     import ascpy
8     self.L = ascpy.Library()
9    
10     def tearDown(self):
11     self.L.clear()
12     del self.L
13    
14 johnpye 932 def testIDA(self):
15     try:
16 johnpye 933 self.L.load('johnpye/shm.a4c')
17     M = self.L.findType('shm').getSimulation('sim')
18 johnpye 938 I = ascpy.Integrator(M)
19     I.setReporter(ascpy.IntegratorReporterCxx(I))
20     I.setEngine('LSODE');
21     I.setLinearTimesteps(ascpy.Units("s"), 0.0, 100.0, 100);
22     I.setMinSubStep(0.005);
23     I.setMaxSubStep(0.5);
24     I.setInitialSubStep(0.01);
25     I.setMaxSubSteps(100);
26     I.analyse();
27     I.solve();
28     print "OBSERVED %d VARS" % I.getNumObservedVars()
29 johnpye 932 except Exception,e:
30     self.fail(str(e))
31    
32 johnpye 669
33 johnpye 932 def testlog10(self):
34 johnpye 933 self.L.load('johnpye/testlog10.a4c')
35     T = self.L.findType('testlog10')
36 johnpye 932 M = T.getSimulation('sim')
37     M.solve(ascpy.Solver("QRSlv"),ascpy.SolverReporter())
38     M.run(T.getMethod('self_test'))
39    
40     class NotToBeTested:
41     def nothing(self):
42     pass
43    
44 johnpye 938 def testloading(self):
45     pass
46    
47     def testsystema4l(self):
48     self.L.load('simpleflowsheet01.a4c')
49    
50     def testatomsa4l(self):
51     self.L.load('atoms.a4l')
52 johnpye 689
53 johnpye 669 if __name__=='__main__':
54     unittest.main()

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22