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

Method test_get_string_from

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

Source from the content-addressed store, hash-verified

1151 unixfrom.encode('ascii') + _bytes_sample_message)
1152
1153 def test_get_string_from(self):
1154 # Get string representations of messages with _unixfrom.
1155 unixfrom = 'From foo@bar blah\n'
1156 key0 = self._box.add(unixfrom + self._template % 0)
1157 key1 = self._box.add(unixfrom + _sample_message)
1158 self.assertEqual(self._box.get_string(key0, from_=False),
1159 self._template % 0)
1160 self.assertEqual(self._box.get_string(key1, from_=False).split('\n'),
1161 _sample_message.split('\n'))
1162 self.assertEqual(self._box.get_string(key0, from_=True),
1163 unixfrom + self._template % 0)
1164 self.assertEqual(self._box.get_string(key1, from_=True).split('\n'),
1165 (unixfrom + _sample_message).split('\n'))
1166
1167 def test_add_from_string(self):
1168 # Add a string starting with 'From ' to the mailbox

Callers

nothing calls this directly

Calls 4

addMethod · 0.45
assertEqualMethod · 0.45
get_stringMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected