comparison test_pymonkey.py @ 32:abf14cba9ef5

JS wrapped Python functions can now return floats.
author Atul Varma <varmaa@toolness.com>
date Tue, 30 Jun 2009 22:37:00 -0700
parents d0a3f358072a
children 5d3d3b25f23f
comparison
equal deleted inserted replaced
31:d0a3f358072a 32:abf14cba9ef5
25 def testJsWrappedPythonFunctionReturnsSmallInt(self): 25 def testJsWrappedPythonFunctionReturnsSmallInt(self):
26 def hai2u(): 26 def hai2u():
27 return 5 27 return 5
28 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), 28 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'),
29 5) 29 5)
30
31 def testJsWrappedPythonFunctionReturnsFloat(self):
32 def hai2u():
33 return 5.1
34 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'),
35 5.1)
30 36
31 def testJsWrappedPythonFunctionReturnsNegativeInt(self): 37 def testJsWrappedPythonFunctionReturnsNegativeInt(self):
32 def hai2u(): 38 def hai2u():
33 return -5 39 return -5
34 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), 40 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'),