MCPcopy Index your code
hub / github.com/python/cpython / test_split_invalid_paths

Method test_split_invalid_paths

Lib/test/test_ntpath.py:268–281  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint/', ''))
267
268 def test_split_invalid_paths(self):
269 split = ntpath.split
270 self.assertEqual(split('c:\\fo\x00o\\ba\x00r'),
271 ('c:\\fo\x00o', 'ba\x00r'))
272 self.assertEqual(split(b'c:\\fo\x00o\\ba\x00r'),
273 (b'c:\\fo\x00o', b'ba\x00r'))
274 self.assertEqual(split('c:\\\udfff\\\udffe'),
275 ('c:\\\udfff', '\udffe'))
276 if sys.platform == 'win32':
277 self.assertRaises(UnicodeDecodeError, split, b'c:\\\xff\\bar')
278 self.assertRaises(UnicodeDecodeError, split, b'c:\\foo\\\xff')
279 else:
280 self.assertEqual(split(b'c:\\\xff\\\xfe'),
281 (b'c:\\\xff', b'\xfe'))
282
283 def test_isabs(self):
284 tester('ntpath.isabs("foo\\bar")', 0)

Callers

nothing calls this directly

Calls 3

splitFunction · 0.50
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected