summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-16 13:14:19 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-16 13:14:19 (GMT)
commitcc83b0c8f6089d67e998b4322000c1805f4cb06e (patch)
tree681cb34e68fc5ff71d78610771c445b955966e25 /Lib/test
parentf5ad91c392199fe8fabeed34d1dce6f8be3a0921 (diff)
parent593568bf47600154b760edf21f22090ff60a2a74 (diff)
downloadcpython-cc83b0c8f6089d67e998b4322000c1805f4cb06e.zip
cpython-cc83b0c8f6089d67e998b4322000c1805f4cb06e.tar.gz
cpython-cc83b0c8f6089d67e998b4322000c1805f4cb06e.tar.bz2
Issue #19912: Fixed numerous bugs in ntpath.splitunc().
* splitunc() no more return illegal result for paths with redundant slashes. * splitunc() now correctly processes the 'İ' character (U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE). * Deprecation warnings now emitted for every use of splitunc(). * Added tests for splitunc().
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_ntpath.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 767a5b1..2e6ba63 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -70,6 +70,29 @@ class TestNtpath(unittest.TestCase):
self.assertEqual(ntpath.splitdrive('//conky/MOUNTPOİNT/foo/bar'),
('//conky/MOUNTPOİNT', '/foo/bar'))
+ def test_splitunc(self):
+ with self.assertWarns(DeprecationWarning):
+ ntpath.splitunc('')
+ with support.check_warnings(('', DeprecationWarning)):
+ 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('//conky/MOUNTPOİNT/foo/bar'),
+ ('//conky/MOUNTPOİNT', '/foo/bar'))
+
def test_split(self):
tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))
tester('ntpath.split("\\\\conky\\mountpoint\\foo\\bar")',