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

Method test_add_binary_nonascii_file

Lib/test/test_mailbox.py:164–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

162 _bytes_sample_message.split(b'\n'))
163
164 def test_add_binary_nonascii_file(self):
165 with tempfile.TemporaryFile('wb+') as f:
166 f.write(self._non_latin_bin_msg)
167 f.seek(0)
168 key = self._box.add(f)
169 self.assertEqual(self._box.get_bytes(key).split(b'\n'),
170 self._non_latin_bin_msg.split(b'\n'))
171
172 def test_add_text_file_warns(self):
173 with tempfile.TemporaryFile('w+', encoding='utf-8') as f:

Callers

nothing calls this directly

Calls 6

writeMethod · 0.45
seekMethod · 0.45
addMethod · 0.45
assertEqualMethod · 0.45
splitMethod · 0.45
get_bytesMethod · 0.45

Tested by

no test coverage detected