(self)
| 238 | tester('ntpath.splitroot("/:/foo")', ("", "/", ":/foo")) |
| 239 | |
| 240 | def test_splitroot_invalid_paths(self): |
| 241 | splitroot = ntpath.splitroot |
| 242 | self.assertEqual(splitroot('\\\\ser\x00ver\\sha\x00re\\di\x00r'), |
| 243 | ('\\\\ser\x00ver\\sha\x00re', '\\', 'di\x00r')) |
| 244 | self.assertEqual(splitroot(b'\\\\ser\x00ver\\sha\x00re\\di\x00r'), |
| 245 | (b'\\\\ser\x00ver\\sha\x00re', b'\\', b'di\x00r')) |
| 246 | self.assertEqual(splitroot("\\\\\udfff\\\udffe\\\udffd"), |
| 247 | ('\\\\\udfff\\\udffe', '\\', '\udffd')) |
| 248 | if sys.platform == 'win32': |
| 249 | self.assertRaises(UnicodeDecodeError, splitroot, b'\\\\\xff\\share\\dir') |
| 250 | self.assertRaises(UnicodeDecodeError, splitroot, b'\\\\server\\\xff\\dir') |
| 251 | self.assertRaises(UnicodeDecodeError, splitroot, b'\\\\server\\share\\\xff') |
| 252 | else: |
| 253 | self.assertEqual(splitroot(b'\\\\\xff\\\xfe\\\xfd'), |
| 254 | (b'\\\\\xff\\\xfe', b'\\', b'\xfd')) |
| 255 | |
| 256 | def test_split(self): |
| 257 | tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar')) |
nothing calls this directly
no test coverage detected