[Python-checkins] python/dist/src/Lib/test test_ntpath.py, 1.18, 1.18.16.1

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Sat Jul 10 22:47:31 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28277/Lib/test

Modified Files:
      Tag: release23-maint
	test_ntpath.py 
Log Message:
ntpath now compresses erroneous slashes between the drive letter and rest of
the path.  Also clarifies handling of UNC paths.  Appropriate test were added.

Fixes bug #980327 with patch #988607.  Thanks Paul Moore.


Index: test_ntpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ntpath.py,v
retrieving revision 1.18
retrieving revision 1.18.16.1
diff -C2 -d -r1.18 -r1.18.16.1
*** test_ntpath.py	24 Dec 2002 18:31:27 -0000	1.18
--- test_ntpath.py	10 Jul 2004 20:47:28 -0000	1.18.16.1
***************
*** 100,109 ****
  tester("ntpath.normpath('e:A/foo/../B')", r'e:A\B')
  
! # Next 3 seem dubious, and especially the 3rd, but normpath is possibly
! # trying to leave UNC paths alone without actually knowing anything about
! # them.
! tester("ntpath.normpath('C:///A//B')", r'C:\\\A\B')
! tester("ntpath.normpath('D:///A/./B')", r'D:\\\A\B')
! tester("ntpath.normpath('e:///A/foo/../B')", r'e:\\\A\B')
  
  tester("ntpath.normpath('..')", r'..')
--- 100,106 ----
  tester("ntpath.normpath('e:A/foo/../B')", r'e:A\B')
  
! tester("ntpath.normpath('C:///A//B')", r'C:\A\B')
! tester("ntpath.normpath('D:///A/./B')", r'D:\A\B')
! tester("ntpath.normpath('e:///A/foo/../B')", r'e:\A\B')
  
  tester("ntpath.normpath('..')", r'..')
***************
*** 116,119 ****
--- 113,118 ----
  tester("ntpath.normpath('../.././..')", r'..\..\..')
  tester("ntpath.normpath('K:../.././..')", r'K:..\..\..')
+ tester("ntpath.normpath('C:////a/b')", r'C:\a\b')
+ tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b')
  
  # ntpath.abspath() can only be used on a system with the "nt" module



More information about the Python-checkins mailing list