MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_open

Method test_open

Lib/test/test_zipfile/_path/test_path.py:137–145  ·  view source on GitHub ↗
(self, alpharep)

Source from the content-addressed store, hash-verified

135
136 @pass_alpharep
137 def test_open(self, alpharep):
138 root = zipfile.Path(alpharep)
139 a, n, b, g, j = root.iterdir()
140 with a.open(encoding="utf-8") as strm:
141 data = strm.read()
142 self.assertEqual(data, "content of a")
143 with a.open('r', "utf-8") as strm: # not a kw, no gh-101144 TypeError
144 data = strm.read()
145 self.assertEqual(data, "content of a")
146
147 def test_open_encoding_utf16(self):
148 in_memory_file = io.BytesIO()

Callers

nothing calls this directly

Calls 4

iterdirMethod · 0.95
openMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected