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

Method test_add_8bit_body

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

Source from the content-addressed store, hash-verified

143 """).encode('utf-8')
144
145 def test_add_8bit_body(self):
146 key = self._box.add(self._non_latin_bin_msg)
147 self.assertEqual(self._box.get_bytes(key),
148 self._non_latin_bin_msg)
149 with self._box.get_file(key) as f:
150 self.assertEqual(f.read(),
151 self._non_latin_bin_msg.replace(b'\n',
152 os.linesep.encode()))
153 self.assertEqual(self._box[key].get_payload(),
154 "Да, они летят.\n")
155
156 def test_add_binary_file(self):
157 with tempfile.TemporaryFile('wb+') as f:

Callers

nothing calls this directly

Calls 8

get_payloadMethod · 0.80
addMethod · 0.45
assertEqualMethod · 0.45
get_bytesMethod · 0.45
get_fileMethod · 0.45
readMethod · 0.45
replaceMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected