aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-04-05 15:38:31 +0000
committerMichael W. Hudson <mwh@python.net>2002-04-05 15:38:31 +0000
commit529e20af0681da89898aca5f70d1c273fde74ddd (patch)
tree696ded3c0269de847be7daee457e2597b9de6446
parentBackport both bits of Guido's fix for bug #503031. (diff)
downloadcpython-529e20af0681da89898aca5f70d1c273fde74ddd.tar.gz
cpython-529e20af0681da89898aca5f70d1c273fde74ddd.tar.bz2
cpython-529e20af0681da89898aca5f70d1c273fde74ddd.zip
backport fdrake's checkin of
revision 1.4 of test_commands.py Make test_commands work on more systems. This removes much of the dependency on how a system is configured. This closes SF bug #497160 (which has the patch) and #460613. Bugfix candidate.
-rw-r--r--Lib/test/test_commands.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_commands.py b/Lib/test/test_commands.py
index 1cd8b8b59cf..aadd419a8a6 100644
--- a/Lib/test/test_commands.py
+++ b/Lib/test/test_commands.py
@@ -30,17 +30,18 @@ class CommandTests(unittest.TestCase):
self.assertNotEquals(status, 0)
def test_getstatus(self):
- # This pattern should match 'ls -ld /bin/ls' on any posix
+ # This pattern should match 'ls -ld /.' on any posix
# system, however perversely configured.
- pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.)
+ pat = r'''d......... # It is a directory.
\s+\d+ # It has some number of links.
\s+\w+\s+\w+ # It has a user and group, which may
# be named anything.
+ \s+\d+ # It has a size.
[^/]* # Skip the date.
- /bin/ls # and end with the name of the file.
+ /. # and end with the name of the file.
'''
- self.assert_(re.match(pat, getstatus("/bin/ls"), re.VERBOSE))
+ self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))
def test_main():