[Python-checkins] CVS: python/dist/src/Lib/test test_commands.py,1.3,1.4
Fred L. Drake
fdrake@users.sourceforge.net
Mon, 01 Apr 2002 15:56:05 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv19857/Lib/test
Modified Files:
test_commands.py
Log Message:
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.
Index: test_commands.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_commands.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_commands.py 30 Oct 2001 03:17:30 -0000 1.3
--- test_commands.py 1 Apr 2002 23:56:03 -0000 1.4
***************
*** 31,45 ****
def test_getstatus(self):
! # This pattern should match 'ls -ld /bin/ls' on any posix
# system, however perversely configured.
! pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.)
\s+\d+ # It has some number of links.
\s+\w+\s+\w+ # It has a user and group, which may
# be named anything.
[^/]* # Skip the date.
! /bin/ls # and end with the name of the file.
'''
! self.assert_(re.match(pat, getstatus("/bin/ls"), re.VERBOSE))
--- 31,46 ----
def test_getstatus(self):
! # This pattern should match 'ls -ld /.' on any posix
# system, however perversely configured.
! 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.
! /. # and end with the name of the file.
'''
! self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))