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

Method test_add_8bit_body

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

Source from the content-addressed store, hash-verified

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