(self)
| 464 | tester("ntpath.normpath('//?/UNC/server/share/..')", '\\\\?\\UNC\\server\\share\\') |
| 465 | |
| 466 | def test_normpath_invalid_paths(self): |
| 467 | normpath = ntpath.normpath |
| 468 | self.assertEqual(normpath('fo\x00o'), 'fo\x00o') |
| 469 | self.assertEqual(normpath(b'fo\x00o'), b'fo\x00o') |
| 470 | self.assertEqual(normpath('fo\x00o\\..\\bar'), 'bar') |
| 471 | self.assertEqual(normpath(b'fo\x00o\\..\\bar'), b'bar') |
| 472 | self.assertEqual(normpath('\udfff'), '\udfff') |
| 473 | self.assertEqual(normpath('\udfff\\..\\foo'), 'foo') |
| 474 | if sys.platform == 'win32': |
| 475 | self.assertRaises(UnicodeDecodeError, normpath, b'\xff') |
| 476 | self.assertRaises(UnicodeDecodeError, normpath, b'\xff\\..\\foo') |
| 477 | else: |
| 478 | self.assertEqual(normpath(b'\xff'), b'\xff') |
| 479 | self.assertEqual(normpath(b'\xff\\..\\foo'), b'foo') |
| 480 | |
| 481 | def test_realpath_curdir(self): |
| 482 | expected = ntpath.normpath(os.getcwd()) |
nothing calls this directly
no test coverage detected