MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_get_file

Method test_get_file

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

Source from the content-addressed store, hash-verified

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