Mercurial > pymonkey
comparison test_pymonkey.py @ 45:03aec8572461
Python-wrapped JS functions can now return null/None.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 06 Jul 2009 00:09:42 -0700 |
parents | 5727675b1bcb |
children | a0f677cfc679 |
comparison
equal
deleted
inserted
replaced
44:0b9a316ce4ef | 45:03aec8572461 |
---|---|
36 def testJsWrappedPythonFunctionReturnsUnicode(self): | 36 def testJsWrappedPythonFunctionReturnsUnicode(self): |
37 def hai2u(cx): | 37 def hai2u(cx): |
38 return u"o hai" | 38 return u"o hai" |
39 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), | 39 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), |
40 u"o hai") | 40 u"o hai") |
41 | |
42 def testJsWrappedPythonFunctionReturnsNone(self): | |
43 def hai2u(cx): | |
44 pass | |
45 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), | |
46 None) | |
41 | 47 |
42 def testJsWrappedPythonFunctionReturnsTrue(self): | 48 def testJsWrappedPythonFunctionReturnsTrue(self): |
43 def hai2u(cx): | 49 def hai2u(cx): |
44 return True | 50 return True |
45 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), | 51 self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'), |