summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2004-07-10 20:42:22 (GMT)
committerBrett Cannon <bcannon@gmail.com>2004-07-10 20:42:22 (GMT)
commitbdc36273a2e1cd4a3985f44261e3c9df5c8a19cc (patch)
tree8a725fdf56a266d62d3b6c50b7f1d880165f6460 /Lib/test/test_ntpath.py
parent85064ffd760687c395f65f74c36d573d94b98436 (diff)
downloadcpython-bdc36273a2e1cd4a3985f44261e3c9df5c8a19cc.zip
cpython-bdc36273a2e1cd4a3985f44261e3c9df5c8a19cc.tar.gz
cpython-bdc36273a2e1cd4a3985f44261e3c9df5c8a19cc.tar.bz2
Make ntpath compress multiple slashes between drive letter and the rest of the
path. Also clarifies UNC handling and adds appropriate tests. Applies patch #988607 to fix bug #980327. Thanks Paul Moore.
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index fdb431a..139aa1f 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -99,12 +99,9 @@ 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')
-# 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('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'..')
tester("ntpath.normpath('.')", r'.')
@@ -115,6 +112,8 @@ tester("ntpath.normpath('/../.././..')", '\\')
tester("ntpath.normpath('c:/../../..')", 'c:\\')
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
# (reasonably), so we protect this test with "import nt". This allows