(self)
| 1246 | tester('ntpath.abspath("/abc/")', drive + "\\abc") |
| 1247 | |
| 1248 | def test_abspath_invalid_paths(self): |
| 1249 | abspath = ntpath.abspath |
| 1250 | if sys.platform == 'win32': |
| 1251 | self.assertEqual(abspath("C:\x00"), ntpath.join(abspath("C:"), "\x00")) |
| 1252 | self.assertEqual(abspath(b"C:\x00"), ntpath.join(abspath(b"C:"), b"\x00")) |
| 1253 | self.assertEqual(abspath("\x00:spam"), "\x00:\\spam") |
| 1254 | self.assertEqual(abspath(b"\x00:spam"), b"\x00:\\spam") |
| 1255 | self.assertEqual(abspath('c:\\fo\x00o'), 'c:\\fo\x00o') |
| 1256 | self.assertEqual(abspath(b'c:\\fo\x00o'), b'c:\\fo\x00o') |
| 1257 | self.assertEqual(abspath('c:\\fo\x00o\\..\\bar'), 'c:\\bar') |
| 1258 | self.assertEqual(abspath(b'c:\\fo\x00o\\..\\bar'), b'c:\\bar') |
| 1259 | self.assertEqual(abspath('c:\\\udfff'), 'c:\\\udfff') |
| 1260 | self.assertEqual(abspath('c:\\\udfff\\..\\foo'), 'c:\\foo') |
| 1261 | if sys.platform == 'win32': |
| 1262 | self.assertRaises(UnicodeDecodeError, abspath, b'c:\\\xff') |
| 1263 | self.assertRaises(UnicodeDecodeError, abspath, b'c:\\\xff\\..\\foo') |
| 1264 | else: |
| 1265 | self.assertEqual(abspath(b'c:\\\xff'), b'c:\\\xff') |
| 1266 | self.assertEqual(abspath(b'c:\\\xff\\..\\foo'), b'c:\\foo') |
| 1267 | |
| 1268 | def test_relpath(self): |
| 1269 | tester('ntpath.relpath("a")', 'a') |
nothing calls this directly
no test coverage detected