/[escript]/trunk/escript/test/python/run_xml.py
ViewVC logotype

Diff of /trunk/escript/test/python/run_xml.py

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

revision 956 by gross, Tue Feb 13 00:03:40 2007 UTC revision 957 by gross, Tue Feb 13 00:33:00 2007 UTC
# Line 215  class ParamaterSetTestCase(unittest.Test Line 215  class ParamaterSetTestCase(unittest.Test
215          assert doc.numtest.type() == numarray.Float64          assert doc.numtest.type() == numarray.Float64
216          assert type(doc.numtest) == numarray.NumArray          assert type(doc.numtest) == numarray.NumArray
217    
218      def testLists(self):      def testBoolLists(self):
219          p4 = ParameterSet()          p4 = ParameterSet()
220          mylist = [True, False, False, True]          mylist = [True, False, False, True]
221          p4.declareParameter(listest=mylist)          p4.declareParameter(listest=mylist)
222          doc = self._class(p4)          doc = self._class(p4)
223            assert type(doc.listest) == numarray.NumArray
224          assert doc.listest.type() == numarray.Bool          assert doc.listest.type() == numarray.Bool
225            assert len(doc.listest) == len(mylist)
226            assert min([ mylist[i] == doc.listest[i] for i in range(len( doc.listest)) ])
227    
228        def testIntLists(self):
229            p4 = ParameterSet()
230            mylist = [1,2,4]
231            p4.declareParameter(listest=mylist)
232            doc = self._class(p4)
233            assert type(doc.listest) == numarray.NumArray
234            assert doc.listest.type() == numarray.Int
235            assert len(doc.listest) == len(mylist)
236            assert min([ mylist[i] == doc.listest[i] for i in range(len( doc.listest)) ])
237    
238        def testFloatLists(self):
239            p4 = ParameterSet()
240            mylist = [1.,2.,4.]
241            p4.declareParameter(listest=mylist)
242            doc = self._class(p4)
243          assert type(doc.listest) == numarray.NumArray          assert type(doc.listest) == numarray.NumArray
244          assert numarray.all(numarray.equal(mylist, doc.listest))          assert doc.listest.type() == numarray.Float
245            assert len(doc.listest) == len(mylist)
246            assert min([ mylist[i] == doc.listest[i] for i in range(len( doc.listest)) ])
247    
248        def testStringLists(self):
249            p4 = ParameterSet()
250            mylist = ["a", "b", "c"]
251            p4.declareParameter(listest=mylist)
252            doc = self._class(p4)
253            assert type(doc.listest) == list
254            assert len(doc.listest) == len(mylist)
255            assert min([ mylist[i] == doc.listest[i] for i in range(len( doc.listest)) ])
256                    
257      def testDatasource(self):      def testDatasource(self):
258          p5 = ParameterSet()          p5 = ParameterSet()

Legend:
Removed from v.956  
changed lines
  Added in v.957

  ViewVC Help
Powered by ViewVC 1.1.26