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

Diff of /trunk/test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 937 by johnpye, Thu Nov 23 22:28:00 2006 UTC revision 938 by johnpye, Fri Nov 24 06:09:46 2006 UTC
# Line 1  Line 1 
1  import unittest  import unittest
2    import ascpy
3    
4  class AscendTest(unittest.TestCase):  class AscendTest(unittest.TestCase):
5    
# Line 14  class AscendTest(unittest.TestCase): Line 15  class AscendTest(unittest.TestCase):
15          try:          try:
16              self.L.load('johnpye/shm.a4c')              self.L.load('johnpye/shm.a4c')
17              M = self.L.findType('shm').getSimulation('sim')              M = self.L.findType('shm').getSimulation('sim')
18              M.solve(ascpy.Solver("QRSlv"),ascpy.SolverReporter())              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          except Exception,e:          except Exception,e:
30              self.fail(str(e))              self.fail(str(e))
31    
     def testloading(self):  
         pass  
   
     def testsystema4l(self):  
         self.L.load('simpleflowsheet01.a4c')  
   
     def testatomsa4l(self):  
         self.L.load('atoms.a4l')  
32    
33      def testlog10(self):      def testlog10(self):
34          self.L.load('johnpye/testlog10.a4c')          self.L.load('johnpye/testlog10.a4c')
# Line 38  class NotToBeTested: Line 41  class NotToBeTested:
41      def nothing(self):      def nothing(self):
42          pass          pass
43    
44        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                    
53  if __name__=='__main__':  if __name__=='__main__':
54      unittest.main()      unittest.main()

Legend:
Removed from v.937  
changed lines
  Added in v.938

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