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

Method test_with_name

Lib/test/test_pathlib/test_join_windows.py:236–243  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

234 self.assertEqual(P('c:/a/trailing.dot.').suffixes, ['.dot', '.'])
235
236 def test_with_name(self):
237 P = self.cls
238 self.assertEqual(P(r'c:a\b').with_name('d.xml'), P(r'c:a\d.xml'))
239 self.assertEqual(P(r'c:\a\b').with_name('d.xml'), P(r'c:\a\d.xml'))
240 self.assertEqual(P(r'c:a\Dot ending.').with_name('d.xml'), P(r'c:a\d.xml'))
241 self.assertEqual(P(r'c:\a\Dot ending.').with_name('d.xml'), P(r'c:\a\d.xml'))
242 self.assertRaises(ValueError, P(r'c:a\b').with_name, r'd:\e')
243 self.assertRaises(ValueError, P(r'c:a\b').with_name, r'\\My\Share')
244
245 def test_with_stem(self):
246 P = self.cls

Callers

nothing calls this directly

Calls 4

PClass · 0.70
assertEqualMethod · 0.45
with_nameMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected