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

Method test_get_bytes_from

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

Source from the content-addressed store, hash-verified

1137 self.assertEqual(f.readlines(), [])
1138
1139 def test_get_bytes_from(self):
1140 # Get bytes representations of messages with _unixfrom.
1141 unixfrom = 'From foo@bar blah\n'
1142 key0 = self._box.add(unixfrom + self._template % 0)
1143 key1 = self._box.add(unixfrom + _sample_message)
1144 self.assertEqual(self._box.get_bytes(key0, from_=False),
1145 (self._template % 0).encode('ascii'))
1146 self.assertEqual(self._box.get_bytes(key1, from_=False),
1147 _bytes_sample_message)
1148 self.assertEqual(self._box.get_bytes(key0, from_=True),
1149 (unixfrom + self._template % 0).encode('ascii'))
1150 self.assertEqual(self._box.get_bytes(key1, from_=True),
1151 unixfrom.encode('ascii') + _bytes_sample_message)
1152
1153 def test_get_string_from(self):
1154 # Get string representations of messages with _unixfrom.

Callers

nothing calls this directly

Calls 4

addMethod · 0.45
assertEqualMethod · 0.45
get_bytesMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected