From: Timothy S. <pe...@us...> - 2004-08-09 13:16:57
|
Update of /cvsroot/pyode/pyode/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30068/tests Modified Files: test_xode.py Log Message: Fixed the XODE parser to work with the new Space classes and added a mechanism to allow the default Space class to be chosen. Index: test_xode.py =================================================================== RCS file: /cvsroot/pyode/pyode/tests/test_xode.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_xode.py 1 Aug 2004 16:47:36 -0000 1.3 --- test_xode.py 9 Aug 2004 13:16:48 -0000 1.4 *************** *** 271,277 **** class TestSpaceParser(TestParser): ! def testInstance(self): ! space = self.root.namedChild('space1').getODEObject() ! self.assert_(isinstance(space, ode.Space)) class TestBodyParser(TestParser): --- 271,310 ---- class TestSpaceParser(TestParser): ! def setUp(self): ! TestParser.setUp(self) ! self.simpleSpace = self.root.namedChild('space1').getODEObject() ! ! doc = '''<?xml version="1.0" encoding="iso-8859-1"?> ! <xode><world> ! <space name="space1"/> ! </world></xode> ! ''' ! ! self.p2 = parser.Parser() ! self.p2.setParams(spaceFactory=ode.HashSpace) ! self.root2 = self.p2.parseString(doc) ! self.hashSpace = self.root2.namedChild('space1').getODEObject() ! ! def makeSpace(): ! return ode.QuadTreeSpace((0, 0, 0), (2, 2, 2), 3) ! ! self.p3 = parser.Parser() ! self.p3.setParams(spaceFactory=makeSpace) ! self.root3 = self.p3.parseString(doc) ! self.quadSpace = self.root3.namedChild('space1').getODEObject() ! ! def testSimpleInstance(self): ! self.assert_(isinstance(self.simpleSpace, ode.SimpleSpace)) ! ! def testHashInstance(self): ! self.assert_(isinstance(self.hashSpace, ode.HashSpace)) ! ! def testQuadInstance(self): ! self.assert_(isinstance(self.quadSpace, ode.QuadTreeSpace)) ! ! def testSpaceBase(self): ! self.assert_(isinstance(self.simpleSpace, ode.SpaceBase)) ! self.assert_(isinstance(self.hashSpace, ode.SpaceBase)) ! self.assert_(isinstance(self.quadSpace, ode.SpaceBase)) class TestBodyParser(TestParser): |