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

Method test_open_binary

Lib/test/test_importlib/resources/test_open.py:22–26  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20
21class OpenTests:
22 def test_open_binary(self):
23 target = resources.files(self.data) / 'binary.file'
24 with target.open('rb') as fp:
25 result = fp.read()
26 self.assertEqual(result, bytes(range(4)))
27
28 def test_open_text_default_encoding(self):
29 target = resources.files(self.data) / 'utf-8.file'

Callers

nothing calls this directly

Calls 4

filesMethod · 0.45
openMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected