summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_commands.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-26 19:04:21 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-26 19:04:21 (GMT)
commita23810f86a53e394936b38ed9c6104fe2cc592cf (patch)
treef39d39741d348f914c151484fce95af2b33b295f /Lib/test/test_commands.py
parent35af8d4218138e74f37a083b7e3c8abd4c0f1c11 (diff)
downloadcpython-a23810f86a53e394936b38ed9c6104fe2cc592cf.zip
cpython-a23810f86a53e394936b38ed9c6104fe2cc592cf.tar.gz
cpython-a23810f86a53e394936b38ed9c6104fe2cc592cf.tar.bz2
The commands module has been removed. The getoutput() and getstatusoutput()
functions have been added to the subprocess module. The fixer for this still needs to be written and proper Py3K deprecation warnings for the functions that didn't make the transition need to be done in 2.6. This is all part of trying to close issue #2872.
Diffstat (limited to 'Lib/test/test_commands.py')
-rw-r--r--Lib/test/test_commands.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/Lib/test/test_commands.py b/Lib/test/test_commands.py
deleted file mode 100644
index b4e48ce..0000000
--- a/Lib/test/test_commands.py
+++ /dev/null
@@ -1,47 +0,0 @@
-'''
- Tests for commands module
- Nick Mathewson
-'''
-import unittest
-import os, tempfile, re
-
-from test.support import TestSkipped, run_unittest, reap_children
-from commands import *
-
-# The module says:
-# "NB This only works (and is only relevant) for UNIX."
-#
-# Actually, getoutput should work on any platform with an os.popen, but
-# I'll take the comment as given, and skip this suite.
-
-if os.name != 'posix':
- raise TestSkipped('Not posix; skipping test_commands')
-
-
-class CommandTests(unittest.TestCase):
-
- def test_getoutput(self):
- self.assertEquals(getoutput('echo xyzzy'), 'xyzzy')
- self.assertEquals(getstatusoutput('echo xyzzy'), (0, 'xyzzy'))
-
- # we use mkdtemp in the next line to create an empty directory
- # under our exclusive control; from that, we can invent a pathname
- # that we _know_ won't exist. This is guaranteed to fail.
- dir = None
- try:
- dir = tempfile.mkdtemp()
- name = os.path.join(dir, "foo")
-
- status, output = getstatusoutput('cat ' + name)
- self.assertNotEquals(status, 0)
- finally:
- if dir is not None:
- os.rmdir(dir)
-
-
-def test_main():
- run_unittest(CommandTests)
- reap_children()
-
-if __name__ == "__main__":
- test_main()