blob: e789e224609b31c8485a8a49f62703296391aeae [file] [log] [blame]
Guido van Rossumead9d8d1999-02-03 17:21:21 +00001import ntpath
Mark Hammond673c6cf2000-08-14 06:21:26 +00002import os
Brian Curtin13a0db52010-09-06 19:46:17 +00003import sys
Victor Stinner1ab6c2d2011-11-15 22:27:41 +01004import unittest
5import warnings
Georg Brandl1b37e872010-03-14 10:45:50 +00006from test.support import TestFailed
Florent Xiclunac9c79782010-03-08 12:24:53 +00007from test import support, test_genericpath
Brian Curtin62857742010-09-06 17:07:27 +00008from tempfile import TemporaryFile
Guido van Rossumead9d8d1999-02-03 17:21:21 +00009
Guido van Rossumead9d8d1999-02-03 17:21:21 +000010
11def tester(fn, wantResult):
Eric S. Raymondfc170b12001-02-09 11:51:27 +000012 fn = fn.replace("\\", "\\\\")
Fred Drake004d5e62000-10-23 17:22:08 +000013 gotResult = eval(fn)
14 if wantResult != gotResult:
Christian Heimesf6cd9672008-03-26 13:45:42 +000015 raise TestFailed("%s should return: %s but returned: %s" \
16 %(str(fn), str(wantResult), str(gotResult)))
Tim Peters6578dc92002-12-24 18:31:27 +000017
Amaury Forgeot d'Arcc72ef8b2008-10-03 18:38:26 +000018 # then with bytes
19 fn = fn.replace("('", "(b'")
20 fn = fn.replace('("', '(b"')
21 fn = fn.replace("['", "[b'")
22 fn = fn.replace('["', '[b"')
23 fn = fn.replace(", '", ", b'")
24 fn = fn.replace(', "', ', b"')
Victor Stinner1ab6c2d2011-11-15 22:27:41 +010025 with warnings.catch_warnings():
26 warnings.simplefilter("ignore", DeprecationWarning)
27 gotResult = eval(fn)
Amaury Forgeot d'Arcc72ef8b2008-10-03 18:38:26 +000028 if isinstance(wantResult, str):
29 wantResult = wantResult.encode('ascii')
30 elif isinstance(wantResult, tuple):
31 wantResult = tuple(r.encode('ascii') for r in wantResult)
32
33 gotResult = eval(fn)
34 if wantResult != gotResult:
35 raise TestFailed("%s should return: %s but returned: %s" \
36 %(str(fn), str(wantResult), repr(gotResult)))
Guido van Rossumead9d8d1999-02-03 17:21:21 +000037
Mark Hammond5a607a32009-05-06 08:04:54 +000038
Christian Heimesf6cd9672008-03-26 13:45:42 +000039class TestNtpath(unittest.TestCase):
40 def test_splitext(self):
41 tester('ntpath.splitext("foo.ext")', ('foo', '.ext'))
42 tester('ntpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext'))
43 tester('ntpath.splitext(".ext")', ('.ext', ''))
44 tester('ntpath.splitext("\\foo.ext\\foo")', ('\\foo.ext\\foo', ''))
45 tester('ntpath.splitext("foo.ext\\")', ('foo.ext\\', ''))
46 tester('ntpath.splitext("")', ('', ''))
47 tester('ntpath.splitext("foo.bar.ext")', ('foo.bar', '.ext'))
48 tester('ntpath.splitext("xx/foo.bar.ext")', ('xx/foo.bar', '.ext'))
49 tester('ntpath.splitext("xx\\foo.bar.ext")', ('xx\\foo.bar', '.ext'))
50 tester('ntpath.splitext("c:a/b\\c.d")', ('c:a/b\\c', '.d'))
Guido van Rossumead9d8d1999-02-03 17:21:21 +000051
Christian Heimesf6cd9672008-03-26 13:45:42 +000052 def test_splitdrive(self):
53 tester('ntpath.splitdrive("c:\\foo\\bar")',
54 ('c:', '\\foo\\bar'))
55 tester('ntpath.splitdrive("c:/foo/bar")',
56 ('c:', '/foo/bar'))
Mark Hammond5a607a32009-05-06 08:04:54 +000057 tester('ntpath.splitdrive("\\\\conky\\mountpoint\\foo\\bar")',
Christian Heimesf6cd9672008-03-26 13:45:42 +000058 ('\\\\conky\\mountpoint', '\\foo\\bar'))
Mark Hammond5a607a32009-05-06 08:04:54 +000059 tester('ntpath.splitdrive("//conky/mountpoint/foo/bar")',
Christian Heimesf6cd9672008-03-26 13:45:42 +000060 ('//conky/mountpoint', '/foo/bar'))
Mark Hammond5a607a32009-05-06 08:04:54 +000061 tester('ntpath.splitdrive("\\\\\\conky\\mountpoint\\foo\\bar")',
62 ('', '\\\\\\conky\\mountpoint\\foo\\bar'))
63 tester('ntpath.splitdrive("///conky/mountpoint/foo/bar")',
64 ('', '///conky/mountpoint/foo/bar'))
65 tester('ntpath.splitdrive("\\\\conky\\\\mountpoint\\foo\\bar")',
66 ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
67 tester('ntpath.splitdrive("//conky//mountpoint/foo/bar")',
68 ('', '//conky//mountpoint/foo/bar'))
Serhiy Storchaka3d7e1152013-12-16 14:34:55 +020069 # Issue #19911: UNC part containing U+0130
70 self.assertEqual(ntpath.splitdrive('//conky/MOUNTPOİNT/foo/bar'),
71 ('//conky/MOUNTPOİNT', '/foo/bar'))
Guido van Rossumead9d8d1999-02-03 17:21:21 +000072
Serhiy Storchaka593568b2013-12-16 15:13:28 +020073 def test_splitunc(self):
74 with self.assertWarns(DeprecationWarning):
75 ntpath.splitunc('')
76 with support.check_warnings(('', DeprecationWarning)):
77 tester('ntpath.splitunc("c:\\foo\\bar")',
78 ('', 'c:\\foo\\bar'))
79 tester('ntpath.splitunc("c:/foo/bar")',
80 ('', 'c:/foo/bar'))
81 tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")',
82 ('\\\\conky\\mountpoint', '\\foo\\bar'))
83 tester('ntpath.splitunc("//conky/mountpoint/foo/bar")',
84 ('//conky/mountpoint', '/foo/bar'))
85 tester('ntpath.splitunc("\\\\\\conky\\mountpoint\\foo\\bar")',
86 ('', '\\\\\\conky\\mountpoint\\foo\\bar'))
87 tester('ntpath.splitunc("///conky/mountpoint/foo/bar")',
88 ('', '///conky/mountpoint/foo/bar'))
89 tester('ntpath.splitunc("\\\\conky\\\\mountpoint\\foo\\bar")',
90 ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
91 tester('ntpath.splitunc("//conky//mountpoint/foo/bar")',
92 ('', '//conky//mountpoint/foo/bar'))
93 self.assertEqual(ntpath.splitunc('//conky/MOUNTPOİNT/foo/bar'),
94 ('//conky/MOUNTPOİNT', '/foo/bar'))
95
Christian Heimesf6cd9672008-03-26 13:45:42 +000096 def test_split(self):
97 tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))
98 tester('ntpath.split("\\\\conky\\mountpoint\\foo\\bar")',
99 ('\\\\conky\\mountpoint\\foo', 'bar'))
Guido van Rossumead9d8d1999-02-03 17:21:21 +0000100
Christian Heimesf6cd9672008-03-26 13:45:42 +0000101 tester('ntpath.split("c:\\")', ('c:\\', ''))
102 tester('ntpath.split("\\\\conky\\mountpoint\\")',
Mark Hammond5a607a32009-05-06 08:04:54 +0000103 ('\\\\conky\\mountpoint\\', ''))
Guido van Rossumead9d8d1999-02-03 17:21:21 +0000104
Christian Heimesf6cd9672008-03-26 13:45:42 +0000105 tester('ntpath.split("c:/")', ('c:/', ''))
Mark Hammond5a607a32009-05-06 08:04:54 +0000106 tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint/', ''))
Mark Hammond673c6cf2000-08-14 06:21:26 +0000107
Christian Heimesf6cd9672008-03-26 13:45:42 +0000108 def test_isabs(self):
109 tester('ntpath.isabs("c:\\")', 1)
110 tester('ntpath.isabs("\\\\conky\\mountpoint\\")', 1)
111 tester('ntpath.isabs("\\foo")', 1)
112 tester('ntpath.isabs("\\foo\\bar")', 1)
Tim Petersd4f7f602001-07-19 19:11:41 +0000113
Christian Heimesf6cd9672008-03-26 13:45:42 +0000114 def test_commonprefix(self):
115 tester('ntpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])',
116 "/home/swen")
117 tester('ntpath.commonprefix(["\\home\\swen\\spam", "\\home\\swen\\eggs"])',
118 "\\home\\swen\\")
119 tester('ntpath.commonprefix(["/home/swen/spam", "/home/swen/spam"])',
120 "/home/swen/spam")
Tim Peters6a3e5f12001-11-05 21:25:02 +0000121
Christian Heimesf6cd9672008-03-26 13:45:42 +0000122 def test_join(self):
123 tester('ntpath.join("")', '')
124 tester('ntpath.join("", "", "")', '')
125 tester('ntpath.join("a")', 'a')
126 tester('ntpath.join("/a")', '/a')
127 tester('ntpath.join("\\a")', '\\a')
128 tester('ntpath.join("a:")', 'a:')
Christian Heimesf6cd9672008-03-26 13:45:42 +0000129 tester('ntpath.join("a:", "\\b")', 'a:\\b')
Christian Heimesf6cd9672008-03-26 13:45:42 +0000130 tester('ntpath.join("a", "\\b")', '\\b')
131 tester('ntpath.join("a", "b", "c")', 'a\\b\\c')
132 tester('ntpath.join("a\\", "b", "c")', 'a\\b\\c')
133 tester('ntpath.join("a", "b\\", "c")', 'a\\b\\c')
134 tester('ntpath.join("a", "b", "\\c")', '\\c')
135 tester('ntpath.join("d:\\", "\\pleep")', 'd:\\pleep')
136 tester('ntpath.join("d:\\", "a", "b")', 'd:\\a\\b')
Tim Peters54a14a32001-08-30 22:05:26 +0000137
Christian Heimesf6cd9672008-03-26 13:45:42 +0000138 tester("ntpath.join('', 'a')", 'a')
139 tester("ntpath.join('', '', '', '', 'a')", 'a')
140 tester("ntpath.join('a', '')", 'a\\')
141 tester("ntpath.join('a', '', '', '', '')", 'a\\')
142 tester("ntpath.join('a\\', '')", 'a\\')
143 tester("ntpath.join('a\\', '', '', '', '')", 'a\\')
Serhiy Storchakac369c2c2014-01-27 23:15:14 +0200144 tester("ntpath.join('a/', '')", 'a/')
Tim Peters54a14a32001-08-30 22:05:26 +0000145
Serhiy Storchakac369c2c2014-01-27 23:15:14 +0200146 tester("ntpath.join('a/b', 'x/y')", 'a/b\\x/y')
147 tester("ntpath.join('/a/b', 'x/y')", '/a/b\\x/y')
148 tester("ntpath.join('/a/b/', 'x/y')", '/a/b/x/y')
149 tester("ntpath.join('c:', 'x/y')", 'c:x/y')
150 tester("ntpath.join('c:a/b', 'x/y')", 'c:a/b\\x/y')
151 tester("ntpath.join('c:a/b/', 'x/y')", 'c:a/b/x/y')
152 tester("ntpath.join('c:/', 'x/y')", 'c:/x/y')
153 tester("ntpath.join('c:/a/b', 'x/y')", 'c:/a/b\\x/y')
154 tester("ntpath.join('c:/a/b/', 'x/y')", 'c:/a/b/x/y')
155 tester("ntpath.join('//computer/share', 'x/y')", '//computer/share\\x/y')
156 tester("ntpath.join('//computer/share/', 'x/y')", '//computer/share/x/y')
157 tester("ntpath.join('//computer/share/a/b', 'x/y')", '//computer/share/a/b\\x/y')
Mark Hammond5a607a32009-05-06 08:04:54 +0000158
Serhiy Storchakac369c2c2014-01-27 23:15:14 +0200159 tester("ntpath.join('a/b', '/x/y')", '/x/y')
160 tester("ntpath.join('/a/b', '/x/y')", '/x/y')
161 tester("ntpath.join('c:', '/x/y')", 'c:/x/y')
162 tester("ntpath.join('c:a/b', '/x/y')", 'c:/x/y')
163 tester("ntpath.join('c:/', '/x/y')", 'c:/x/y')
164 tester("ntpath.join('c:/a/b', '/x/y')", 'c:/x/y')
165 tester("ntpath.join('//computer/share', '/x/y')", '//computer/share/x/y')
166 tester("ntpath.join('//computer/share/', '/x/y')", '//computer/share/x/y')
167 tester("ntpath.join('//computer/share/a', '/x/y')", '//computer/share/x/y')
168
169 tester("ntpath.join('c:', 'C:x/y')", 'C:x/y')
170 tester("ntpath.join('c:a/b', 'C:x/y')", 'C:a/b\\x/y')
171 tester("ntpath.join('c:/', 'C:x/y')", 'C:/x/y')
172 tester("ntpath.join('c:/a/b', 'C:x/y')", 'C:/a/b\\x/y')
173
174 for x in ('', 'a/b', '/a/b', 'c:', 'c:a/b', 'c:/', 'c:/a/b',
175 '//computer/share', '//computer/share/', '//computer/share/a/b'):
176 for y in ('d:', 'd:x/y', 'd:/', 'd:/x/y',
177 '//machine/common', '//machine/common/', '//machine/common/x/y'):
178 tester("ntpath.join(%r, %r)" % (x, y), y)
Mark Hammond5a607a32009-05-06 08:04:54 +0000179
180 tester("ntpath.join('\\\\computer\\share\\', 'a', 'b')", '\\\\computer\\share\\a\\b')
181 tester("ntpath.join('\\\\computer\\share', 'a', 'b')", '\\\\computer\\share\\a\\b')
182 tester("ntpath.join('\\\\computer\\share', 'a\\b')", '\\\\computer\\share\\a\\b')
183 tester("ntpath.join('//computer/share/', 'a', 'b')", '//computer/share/a\\b')
184 tester("ntpath.join('//computer/share', 'a', 'b')", '//computer/share\\a\\b')
185 tester("ntpath.join('//computer/share', 'a/b')", '//computer/share\\a/b')
186
Christian Heimesf6cd9672008-03-26 13:45:42 +0000187 def test_normpath(self):
188 tester("ntpath.normpath('A//////././//.//B')", r'A\B')
189 tester("ntpath.normpath('A/./B')", r'A\B')
190 tester("ntpath.normpath('A/foo/../B')", r'A\B')
191 tester("ntpath.normpath('C:A//B')", r'C:A\B')
192 tester("ntpath.normpath('D:A/./B')", r'D:A\B')
193 tester("ntpath.normpath('e:A/foo/../B')", r'e:A\B')
Tim Peters54a14a32001-08-30 22:05:26 +0000194
Christian Heimesf6cd9672008-03-26 13:45:42 +0000195 tester("ntpath.normpath('C:///A//B')", r'C:\A\B')
196 tester("ntpath.normpath('D:///A/./B')", r'D:\A\B')
197 tester("ntpath.normpath('e:///A/foo/../B')", r'e:\A\B')
Thomas Woutersb2137042007-02-01 18:02:27 +0000198
Christian Heimesf6cd9672008-03-26 13:45:42 +0000199 tester("ntpath.normpath('..')", r'..')
200 tester("ntpath.normpath('.')", r'.')
201 tester("ntpath.normpath('')", r'.')
202 tester("ntpath.normpath('/')", '\\')
203 tester("ntpath.normpath('c:/')", 'c:\\')
204 tester("ntpath.normpath('/../.././..')", '\\')
205 tester("ntpath.normpath('c:/../../..')", 'c:\\')
206 tester("ntpath.normpath('../.././..')", r'..\..\..')
207 tester("ntpath.normpath('K:../.././..')", r'K:..\..\..')
208 tester("ntpath.normpath('C:////a/b')", r'C:\a\b')
209 tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b')
Fred Drake5e997312002-01-15 03:46:43 +0000210
Georg Brandlcfb68212010-07-31 21:40:15 +0000211 tester("ntpath.normpath('\\\\.\\NUL')", r'\\.\NUL')
212 tester("ntpath.normpath('\\\\?\\D:/XY\\Z')", r'\\?\D:/XY\Z')
213
Christian Heimesf6cd9672008-03-26 13:45:42 +0000214 def test_expandvars(self):
Walter Dörwald155374d2009-05-01 19:58:58 +0000215 with support.EnvironmentVarGuard() as env:
216 env.clear()
217 env["foo"] = "bar"
218 env["{foo"] = "baz1"
219 env["{foo}"] = "baz2"
Christian Heimesf6cd9672008-03-26 13:45:42 +0000220 tester('ntpath.expandvars("foo")', "foo")
221 tester('ntpath.expandvars("$foo bar")', "bar bar")
222 tester('ntpath.expandvars("${foo}bar")', "barbar")
223 tester('ntpath.expandvars("$[foo]bar")', "$[foo]bar")
224 tester('ntpath.expandvars("$bar bar")', "$bar bar")
225 tester('ntpath.expandvars("$?bar")', "$?bar")
226 tester('ntpath.expandvars("${foo}bar")', "barbar")
227 tester('ntpath.expandvars("$foo}bar")', "bar}bar")
228 tester('ntpath.expandvars("${foo")', "${foo")
229 tester('ntpath.expandvars("${{foo}}")', "baz1}")
230 tester('ntpath.expandvars("$foo$foo")', "barbar")
231 tester('ntpath.expandvars("$bar$bar")', "$bar$bar")
232 tester('ntpath.expandvars("%foo% bar")', "bar bar")
233 tester('ntpath.expandvars("%foo%bar")', "barbar")
234 tester('ntpath.expandvars("%foo%%foo%")', "barbar")
235 tester('ntpath.expandvars("%%foo%%foo%foo%")', "%foo%foobar")
236 tester('ntpath.expandvars("%?bar%")', "%?bar%")
237 tester('ntpath.expandvars("%foo%%bar")', "bar%bar")
238 tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar")
Guido van Rossumd8faa362007-04-27 19:54:29 +0000239
Christian Heimesf6cd9672008-03-26 13:45:42 +0000240 def test_abspath(self):
241 # ntpath.abspath() can only be used on a system with the "nt" module
242 # (reasonably), so we protect this test with "import nt". This allows
243 # the rest of the tests for the ntpath module to be run to completion
244 # on any platform, since most of the module is intended to be usable
245 # from any platform.
246 try:
247 import nt
Mark Hammond5a607a32009-05-06 08:04:54 +0000248 tester('ntpath.abspath("C:\\")', "C:\\")
Christian Heimesf6cd9672008-03-26 13:45:42 +0000249 except ImportError:
Zachary Ware9fe6d862013-12-08 00:20:35 -0600250 self.skipTest('nt module not available')
Christian Heimesf6cd9672008-03-26 13:45:42 +0000251
252 def test_relpath(self):
253 currentdir = os.path.split(os.getcwd())[-1]
254 tester('ntpath.relpath("a")', 'a')
255 tester('ntpath.relpath(os.path.abspath("a"))', 'a')
256 tester('ntpath.relpath("a/b")', 'a\\b')
257 tester('ntpath.relpath("../a/b")', '..\\a\\b')
258 tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a')
259 tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b')
260 tester('ntpath.relpath("a", "b/c")', '..\\..\\a')
Mark Hammond5a607a32009-05-06 08:04:54 +0000261 tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat')
Christian Heimesf6cd9672008-03-26 13:45:42 +0000262 tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')
263 tester('ntpath.relpath("a", "a")', '.')
Mark Hammond5a607a32009-05-06 08:04:54 +0000264 tester('ntpath.relpath("/foo/bar/bat", "/x/y/z")', '..\\..\\..\\foo\\bar\\bat')
265 tester('ntpath.relpath("/foo/bar/bat", "/foo/bar")', 'bat')
266 tester('ntpath.relpath("/foo/bar/bat", "/")', 'foo\\bar\\bat')
267 tester('ntpath.relpath("/", "/foo/bar/bat")', '..\\..\\..')
268 tester('ntpath.relpath("/foo/bar/bat", "/x")', '..\\foo\\bar\\bat')
269 tester('ntpath.relpath("/x", "/foo/bar/bat")', '..\\..\\..\\x')
270 tester('ntpath.relpath("/", "/")', '.')
271 tester('ntpath.relpath("/a", "/a")', '.')
272 tester('ntpath.relpath("/a/b", "/a/b")', '.')
Hirokazu Yamamotob08820a2010-10-18 12:13:18 +0000273 tester('ntpath.relpath("c:/foo", "C:/FOO")', '.')
Christian Heimesf6cd9672008-03-26 13:45:42 +0000274
Brian Curtin62857742010-09-06 17:07:27 +0000275 def test_sameopenfile(self):
276 with TemporaryFile() as tf1, TemporaryFile() as tf2:
277 # Make sure the same file is really the same
278 self.assertTrue(ntpath.sameopenfile(tf1.fileno(), tf1.fileno()))
279 # Make sure different files are really different
280 self.assertFalse(ntpath.sameopenfile(tf1.fileno(), tf2.fileno()))
Brian Curtin13a0db52010-09-06 19:46:17 +0000281 # Make sure invalid values don't cause issues on win32
282 if sys.platform == "win32":
Hirokazu Yamamoto26253bb2010-12-05 04:16:47 +0000283 with self.assertRaises(OSError):
Brian Curtin13a0db52010-09-06 19:46:17 +0000284 # Invalid file descriptors shouldn't display assert
285 # dialogs (#4804)
286 ntpath.sameopenfile(-1, -1)
Brian Curtin62857742010-09-06 17:07:27 +0000287
Tim Golden6b528062013-08-01 12:44:00 +0100288 def test_ismount(self):
289 self.assertTrue(ntpath.ismount("c:\\"))
290 self.assertTrue(ntpath.ismount("C:\\"))
291 self.assertTrue(ntpath.ismount("c:/"))
292 self.assertTrue(ntpath.ismount("C:/"))
293 self.assertTrue(ntpath.ismount("\\\\.\\c:\\"))
294 self.assertTrue(ntpath.ismount("\\\\.\\C:\\"))
295
296 self.assertTrue(ntpath.ismount(b"c:\\"))
297 self.assertTrue(ntpath.ismount(b"C:\\"))
298 self.assertTrue(ntpath.ismount(b"c:/"))
299 self.assertTrue(ntpath.ismount(b"C:/"))
300 self.assertTrue(ntpath.ismount(b"\\\\.\\c:\\"))
301 self.assertTrue(ntpath.ismount(b"\\\\.\\C:\\"))
302
303 with support.temp_dir() as d:
304 self.assertFalse(ntpath.ismount(d))
305
Tim Goldenb2fcebb2013-08-01 13:58:58 +0100306 if sys.platform == "win32":
307 #
308 # Make sure the current folder isn't the root folder
309 # (or any other volume root). The drive-relative
310 # locations below cannot then refer to mount points
311 #
312 drive, path = ntpath.splitdrive(sys.executable)
313 with support.change_cwd(os.path.dirname(sys.executable)):
314 self.assertFalse(ntpath.ismount(drive.lower()))
315 self.assertFalse(ntpath.ismount(drive.upper()))
Tim Golden6b528062013-08-01 12:44:00 +0100316
Tim Goldenb2fcebb2013-08-01 13:58:58 +0100317 self.assertTrue(ntpath.ismount("\\\\localhost\\c$"))
318 self.assertTrue(ntpath.ismount("\\\\localhost\\c$\\"))
Tim Golden6b528062013-08-01 12:44:00 +0100319
Tim Goldenb2fcebb2013-08-01 13:58:58 +0100320 self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$"))
321 self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$\\"))
Christian Heimesf6cd9672008-03-26 13:45:42 +0000322
Ezio Melottid0dfe9a2013-01-10 03:12:50 +0200323class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
Florent Xiclunac9c79782010-03-08 12:24:53 +0000324 pathmodule = ntpath
325 attributes = ['relpath', 'splitunc']
326
327
Christian Heimesf6cd9672008-03-26 13:45:42 +0000328if __name__ == "__main__":
329 unittest.main()