X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec873c943d71f0d5f13e3398557071448cda6c23..a4027e74873007e3430af3bd77019bcab76f6c04:/wxPython/wx/py/tests/test_interpreter.py diff --git a/wxPython/wx/py/tests/test_interpreter.py b/wxPython/wx/py/tests/test_interpreter.py deleted file mode 100644 index 9ab26a091f..0000000000 --- a/wxPython/wx/py/tests/test_interpreter.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import unittest - -# Import from this module's parent directory. -import os -import sys -sys.path.insert(0, os.pardir) -import interpreter -del sys.path[0] -del sys -del os - - -""" -These unittest methods are preferred: -------------------------------------- -self.assert_(expr, msg=None) -self.assertEqual(first, second, msg=None) -self.assertRaises(excClass, callableObj, *args, **kwargs) -self.fail(msg=None) -self.failIf(expr, msg=None) -""" - - -class ModuleTestCase(unittest.TestCase): - - def test_module(self): - module = interpreter - self.assert_(module.__author__) - self.assert_(module.__cvsid__) - self.assert_(module.__revision__) - self.assert_(module.Interpreter) - self.assert_(module.Interpreter.push) - self.assert_(module.Interpreter.runsource) - self.assert_(module.Interpreter.getAutoCompleteList) - self.assert_(module.Interpreter.getCallTip) - self.assert_(module.InterpreterAlaCarte) - - -class InterpreterTestCase(unittest.TestCase): - - def setUp(self): - self.output = '' - self.i = interpreter.Interpreter(stdout=self) - - def write(self, text): - """Capture output from self.i.push().""" - self.output += text - - def tearDown(self): - self.output = '' - self.i = None - del self.i - - def test_more(self): - self.assertEqual(self.i.push('dir()'), 0) - self.assertEqual(self.i.push('for n in range(3):'), 1) - - def test_push(self): - values = ( - ('dir', ''), - ('dir()', "['__builtins__', '__doc__', '__name__']"), - ('2 + 2', '4'), - ('d = {}', ''), - ('d', '{}'), - ('del d', ''), - ('len([4,5,6])', '3'), - ) - for input, output in values: - if output: output += '\n' - self.i.push(input) - self.assertEqual(self.output, output) - self.output = '' - - -if __name__ == '__main__': - unittest.main()