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

Method test_with_stem

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

Source from the content-addressed store, hash-verified

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
247 self.assertEqual(P('c:a/b').with_stem('d'), P('c:a/d'))
248 self.assertEqual(P('c:/a/b').with_stem('d'), P('c:/a/d'))
249 self.assertEqual(P('c:a/Dot ending.').with_stem('d'), P('c:a/d.'))
250 self.assertEqual(P('c:/a/Dot ending.').with_stem('d'), P('c:/a/d.'))
251 self.assertRaises(ValueError, P('c:a/b').with_stem, 'd:/e')
252 self.assertRaises(ValueError, P('c:a/b').with_stem, '//My/Share')
253
254 def test_with_suffix(self):
255 P = self.cls

Callers

nothing calls this directly

Calls 4

PClass · 0.70
assertEqualMethod · 0.45
with_stemMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected