Revision: 604 http://rpy.svn.sourceforge.net/rpy/?rev=604&view=rev Author: lgautier Date: 2008-08-03 09:13:04 +0000 (Sun, 03 Aug 2008)
Log Message: ----------- tests for objects dispatch (weird failure of one test while it seems to be working any time outside the tests) Modified Paths: -------------- branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py 2008-08-03 09:11:31 UTC (rev 603) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py 2008-08-03 09:13:04 UTC (rev 604) @@ -20,14 +20,31 @@ self.assertEquals('[1] "3"\n', str.join('', buf)) rinterface.setWriteConsole(rinterface.consolePrint) - def testCallWhenEndedR(self): + def testCallErrorWhenEndedR(self): t = rinterface.baseNameSpaceEnv['date'] rinterface.endEmbeddedR(1) self.assertRaises(RuntimeError, t) rinterface.initEmbeddedR() + +class ObjectDispatchTestCase(unittest.TestCase): + def testObjectDispatchLang(self): + formula = rinterface.globalEnv.get('formula') + obj = formula(rinterface.StrSexpVector(['y ~ x', ])) + self.assertTrue(isinstance(obj, rinterface.SexpLang)) + + def testObjectDispatchVector(self): + letters = rinterface.globalEnv.get('letters') + self.assertTrue(isinstance(letters, rinterface.SexpVector)) + + def testObjectDispatchClosure(self): + #import pdb; pdb.set_trace() + help = rinterface.globalEnv.get('sum') + self.assertTrue(isinstance(help, rinterface.SexpClosure)) + def suite(): suite = unittest.TestLoader().loadTestsFromTestCase(EmbeddedRTestCase) + suite.addTest(unittest.TestLoader().loadTestsFromTestCase(ObjectDispatchTestCase)) return suite if __name__ == '__main__': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list