Mercurial > pymonkey
diff tests/test_pymonkey.py @ 138:1a982ee56458
A script's bytecode is now exposed as a buffer object.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 23 Aug 2009 22:26:58 -0700 |
parents | f83a1603c417 |
children | ce8099238c01 |
line wrap: on
line diff
--- a/tests/test_pymonkey.py Sun Aug 23 21:59:39 2009 -0700 +++ b/tests/test_pymonkey.py Sun Aug 23 22:26:58 2009 -0700 @@ -48,6 +48,13 @@ u'SyntaxError: missing ; before statement' ) + def testScriptIsExposedAsBuffer(self): + rt = pymonkey.Runtime() + cx = rt.new_context() + obj = cx.new_object() + script = cx.compile_script(obj, 'foo', '<string>', 1) + self.assertTrue(len(buffer(script)) > 0) + def testCompileScriptWorks(self): self.assertEqual(self._execjs('5 + 1'), 6)