diff options
Diffstat (limited to 'python/helpers/pydev/tests_python/test_pydev_monkey.py')
-rw-r--r-- | python/helpers/pydev/tests_python/test_pydev_monkey.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/python/helpers/pydev/tests_python/test_pydev_monkey.py b/python/helpers/pydev/tests_python/test_pydev_monkey.py index 3eb7930b73ae..be1312a066d3 100644 --- a/python/helpers/pydev/tests_python/test_pydev_monkey.py +++ b/python/helpers/pydev/tests_python/test_pydev_monkey.py @@ -1,17 +1,32 @@ import unittest import pydev_monkey import sys +from pydevd import SetupHolder +from pydev_monkey import pydev_src_dir class TestCase(unittest.TestCase): def test_monkey(self): - check='''C:\\bin\\python.exe -u -c " + original = SetupHolder.setup + + try: + SetupHolder.setup = {'client':'127.0.0.1', 'port': '0'} + check='''C:\\bin\\python.exe -u -c " connect(\\"127.0.0.1\\") "''' - sys.original_argv = [] - self.assertEqual('"-u" "-c" "\nconnect(\\"127.0.0.1\\")\n"', pydev_monkey.patch_arg_str_win(check)) + sys.original_argv = [] + self.assertEqual( + '"C:\\bin\\python.exe" "-u" "-c" "import sys; ' + 'sys.path.append(r\'%s\'); ' + 'import pydevd; pydevd.settrace(host=\'127.0.0.1\', port=0, suspend=False, ' + 'trace_only_current_thread=False, patch_multiprocessing=True); ' + '\nconnect(\\"127.0.0.1\\")\n"' % pydev_src_dir, + pydev_monkey.patch_arg_str_win(check) + ) + finally: + SetupHolder.setup = original def test_str_to_args_windows(self): |