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

Method test_initialize_with_file

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

Source from the content-addressed store, hash-verified

1577 self._check_sample(msg)
1578
1579 def test_initialize_with_file(self):
1580 # Initialize based on contents of file
1581 with open(self._path, 'w+', encoding='utf-8') as f:
1582 f.write(_sample_message)
1583 f.seek(0)
1584 msg = self._factory(f)
1585 self._post_initialize_hook(msg)
1586 self._check_sample(msg)
1587
1588 def test_initialize_with_binary_file(self):
1589 # Initialize based on contents of binary file

Callers

nothing calls this directly

Calls 6

_post_initialize_hookMethod · 0.95
_factoryMethod · 0.80
_check_sampleMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected