Changeset 391 for python/trunk/Lib/test/test_popen.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_popen.py
r2 r391 15 15 # We can then eval() the result of this, and see what each argv was. 16 16 python = sys.executable 17 if ' ' in python:18 python = '"' + python + '"' # quote embedded space for cmdline19 17 20 18 class PopenTest(unittest.TestCase): 21 19 def _do_test_commandline(self, cmdline, expected): 22 20 cmd = '%s -c "import sys;print sys.argv" %s' % (python, cmdline) 23 data = os.popen(cmd).read() 21 data = os.popen(cmd).read() + '\n' 24 22 got = eval(data)[1:] # strip off argv[0] 25 23 self.assertEqual(got, expected) … … 41 39 test_support.reap_children() 42 40 41 def test_return_code(self): 42 self.assertEqual(os.popen("exit 0").close(), None) 43 if os.name == 'nt': 44 self.assertEqual(os.popen("exit 42").close(), 42) 45 else: 46 self.assertEqual(os.popen("exit 42").close(), 42 << 8) 47 43 48 def test_main(): 44 49 test_support.run_unittest(PopenTest)
Note:
See TracChangeset
for help on using the changeset viewer.