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

Method test_add_text_file_warns

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

Source from the content-addressed store, hash-verified

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:
174 f.write(_sample_message)
175 f.seek(0)
176 with self.assertWarns(DeprecationWarning):
177 key = self._box.add(f)
178 self.assertEqual(self._box.get_bytes(key).split(b'\n'),
179 _bytes_sample_message.split(b'\n'))
180
181 def test_add_StringIO_warns(self):
182 with self.assertWarns(DeprecationWarning):

Callers

nothing calls this directly

Calls 7

assertWarnsMethod · 0.80
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