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

Method test_bytes

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

Source from the content-addressed store, hash-verified

315 self._check_str(os.fspath(p), ('a/b',))
316
317 def test_bytes(self):
318 P = self.cls
319 with self.assertRaises(TypeError):
320 P(b'a')
321 with self.assertRaises(TypeError):
322 P(b'a', 'b')
323 with self.assertRaises(TypeError):
324 P('a', b'b')
325 with self.assertRaises(TypeError):
326 P('a').joinpath(b'b')
327 with self.assertRaises(TypeError):
328 P('a') / b'b'
329 with self.assertRaises(TypeError):
330 b'a' / P('b')
331 with self.assertRaises(TypeError):
332 P('a').match(b'b')
333 with self.assertRaises(TypeError):
334 P('a').relative_to(b'b')
335 with self.assertRaises(TypeError):
336 P('a').with_name(b'b')
337 with self.assertRaises(TypeError):
338 P('a').with_stem(b'b')
339 with self.assertRaises(TypeError):
340 P('a').with_suffix(b'b')
341
342 def test_bytes_exc_message(self):
343 P = self.cls

Callers

nothing calls this directly

Calls 8

PClass · 0.70
assertRaisesMethod · 0.45
joinpathMethod · 0.45
matchMethod · 0.45
relative_toMethod · 0.45
with_nameMethod · 0.45
with_stemMethod · 0.45
with_suffixMethod · 0.45

Tested by

no test coverage detected