diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-01 23:56:03 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-01 23:56:03 (GMT) |
commit | 4993c51b9436bc28126659519c362558fdcdd0d7 (patch) | |
tree | 719eba81e5e3a8a5a032d2ccd91a3e27a607adbc /Lib/test/test_commands.py | |
parent | 4dfb7a81c1bc80d8e4d1d8279d6df81aac4d01e6 (diff) | |
download | cpython-4993c51b9436bc28126659519c362558fdcdd0d7.zip cpython-4993c51b9436bc28126659519c362558fdcdd0d7.tar.gz cpython-4993c51b9436bc28126659519c362558fdcdd0d7.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_commands.py')
-rw-r--r-- | Lib/test/test_commands.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_commands.py b/Lib/test/test_commands.py index 1cd8b8b..aadd419 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(): |