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

Method test_with_name_windows

Lib/test/test_pathlib/test_pathlib.py:506–515  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

504
505 @needs_windows
506 def test_with_name_windows(self):
507 P = self.cls
508 self.assertRaises(ValueError, P(r'c:').with_name, 'd.xml')
509 self.assertRaises(ValueError, P(r'c:\\').with_name, 'd.xml')
510 self.assertRaises(ValueError, P(r'\\My\Share').with_name, 'd.xml')
511 # NTFS alternate data streams
512 self.assertEqual(str(P('a').with_name('d:')), '.\\d:')
513 self.assertEqual(str(P('a').with_name('d:e')), '.\\d:e')
514 self.assertEqual(P(r'c:a\b').with_name('d:'), P(r'c:a\d:'))
515 self.assertEqual(P(r'c:a\b').with_name('d:e'), P(r'c:a\d:e'))
516
517 def test_with_name_empty(self):
518 P = self.cls

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
PClass · 0.70
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
with_nameMethod · 0.45

Tested by

no test coverage detected