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

Method test_get_file

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

Source from the content-addressed store, hash-verified

285 _sample_message.split('\n'))
286
287 def test_get_file(self):
288 # Get file representations of messages
289 key0 = self._box.add(self._template % 0)
290 key1 = self._box.add(_sample_message)
291 with self._box.get_file(key0) as file:
292 data0 = file.read()
293 with self._box.get_file(key1) as file:
294 data1 = file.read()
295 self.assertEqual(data0.decode('ascii').replace(os.linesep, '\n'),
296 self._template % 0)
297 self.assertEqual(data1.decode('ascii').replace(os.linesep, '\n'),
298 _sample_message)
299
300 def test_get_file_can_be_closed_twice(self):
301 # Issue 11700

Callers

nothing calls this directly

Calls 6

addMethod · 0.45
get_fileMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45
replaceMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected