Mercurial > pydertron
view test_pydertron.py @ 32:e3fcfa2bf3bc
Added sandbox.finish() to end of test.
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Mon, 10 May 2010 01:55:47 -0700 |
parents | 3897ed8a350d |
children | 056025f2c8ae |
line wrap: on
line source
import unittest from StringIO import StringIO import pydertron class PydertronTests(unittest.TestCase): def testNullFilesystem(self): stderr = StringIO() sandbox = pydertron.JsSandbox(pydertron.NullFileSystem()) sandbox.set_globals() sandbox.run_script("require('hi');", stderr=stderr) self.assertEqual(stderr.getvalue(), 'Traceback (most recent call last):\n' ' File "<string>", line 1, in <module>\n' 'Module not found: hi\n') sandbox.finish() if __name__ == '__main__': unittest.main()