Mercurial > pymonkey
diff test_pymonkey.py @ 20:abede8af8cf5
PYM_jsvalToPyObject() can now deal with JSObjects.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 28 Jun 2009 20:19:39 -0700 |
parents | 0812422ec99e |
children | 988a8998c75f |
line wrap: on
line diff
--- a/test_pymonkey.py Sun Jun 28 20:08:59 2009 -0700 +++ b/test_pymonkey.py Sun Jun 28 20:19:39 2009 -0700 @@ -51,6 +51,15 @@ self.assertTrue(type(retval) == unicode) self.assertEqual(retval, u'o hai\u2026') + def testEvaluateReturnsObject(self): + rt = pymonkey.Runtime() + cx = rt.new_context() + obj = cx.new_object() + cx.init_standard_classes(obj) + obj = cx.evaluate_script(obj, '({boop: 1})', '<string>', 1) + self.assertTrue(isinstance(obj, pymonkey.Object)) + self.assertEqual(cx.get_property(obj, "boop"), 1) + def testEvaluateReturnsTrue(self): self.assertTrue(self._evaljs('true') is True)