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

Method test_open_close_open

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

Source from the content-addressed store, hash-verified

1199 key = self._box.add(msg)
1200
1201 def test_open_close_open(self):
1202 # Open and inspect previously-created mailbox
1203 values = [self._template % i for i in range(3)]
1204 for value in values:
1205 self._box.add(value)
1206 self._box.close()
1207 mtime = os.path.getmtime(self._path)
1208 self._box = self._factory(self._path)
1209 self.assertEqual(len(self._box), 3)
1210 for key in self._box.iterkeys():
1211 self.assertIn(self._box.get_string(key), values)
1212 self._box.close()
1213 self.assertEqual(mtime, os.path.getmtime(self._path))
1214
1215 def test_add_and_close(self):
1216 # Verifying that closing a mailbox doesn't change added items

Callers

nothing calls this directly

Calls 7

_factoryMethod · 0.80
assertInMethod · 0.80
addMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45
iterkeysMethod · 0.45
get_stringMethod · 0.45

Tested by

no test coverage detected