summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-16 13:15:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-16 13:15:29 (GMT)
commitdd5a46c696a127a947e015741c4565878d72b3d4 (patch)
treea4b3468e08c9aff21c29371c7964127b73649da9 /Lib/test/test_ntpath.py
parentd1a61dcc65a85639f273b31fd32267092db9a06e (diff)
downloadcpython-dd5a46c696a127a947e015741c4565878d72b3d4.zip
cpython-dd5a46c696a127a947e015741c4565878d72b3d4.tar.gz
cpython-dd5a46c696a127a947e015741c4565878d72b3d4.tar.bz2
Issue #19912: Fixed numerous bugs in ntpath.splitunc().
* splitunc() no more returns illegal result for paths with redundant slashes. * splitunc() now correctly processes the u'İ' character (U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE). * Added new tests for splitunc().
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index e1852c0..749afbc 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -33,10 +33,24 @@ class TestNtpath(unittest.TestCase):
('c:', '/foo/bar'))
def test_splitunc(self):
+ tester('ntpath.splitunc("c:\\foo\\bar")',
+ ('', 'c:\\foo\\bar'))
+ tester('ntpath.splitunc("c:/foo/bar")',
+ ('', 'c:/foo/bar'))
tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")',
('\\\\conky\\mountpoint', '\\foo\\bar'))
tester('ntpath.splitunc("//conky/mountpoint/foo/bar")',
('//conky/mountpoint', '/foo/bar'))
+ tester('ntpath.splitunc("\\\\\\conky\\mountpoint\\foo\\bar")',
+ ('', '\\\\\\conky\\mountpoint\\foo\\bar'))
+ tester('ntpath.splitunc("///conky/mountpoint/foo/bar")',
+ ('', '///conky/mountpoint/foo/bar'))
+ tester('ntpath.splitunc("\\\\conky\\\\mountpoint\\foo\\bar")',
+ ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
+ tester('ntpath.splitunc("//conky//mountpoint/foo/bar")',
+ ('', '//conky//mountpoint/foo/bar'))
+ self.assertEqual(ntpath.splitunc(u'//conky/MOUNTPO\u0130NT/foo/bar'),
+ (u'//conky/MOUNTPO\u0130NT', u'/foo/bar'))
def test_split(self):
tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))