[Python-checkins] CVS: python/dist/src/Lib/test test_commands.py,1.3,1.3.8.1

Michael Hudson mwh@users.sourceforge.net
Fri, 05 Apr 2002 07:38:34 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv31914

Modified Files:
      Tag: release22-maint
	test_commands.py 
Log Message:
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.


Index: test_commands.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_commands.py,v
retrieving revision 1.3
retrieving revision 1.3.8.1
diff -C2 -d -r1.3 -r1.3.8.1
*** test_commands.py	30 Oct 2001 03:17:30 -0000	1.3
--- test_commands.py	5 Apr 2002 15:38:31 -0000	1.3.8.1
***************
*** 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))