MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_open_close_open

Method test_open_close_open

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

Source from the content-addressed store, hash-verified

1185 key = self._box.add(msg)
1186
1187 def test_open_close_open(self):
1188 # Open and inspect previously-created mailbox
1189 values = [self._template % i for i in range(3)]
1190 for value in values:
1191 self._box.add(value)
1192 self._box.close()
1193 mtime = os.path.getmtime(self._path)
1194 self._box = self._factory(self._path)
1195 self.assertEqual(len(self._box), 3)
1196 for key in self._box.iterkeys():
1197 self.assertIn(self._box.get_string(key), values)
1198 self._box.close()
1199 self.assertEqual(mtime, os.path.getmtime(self._path))
1200
1201 def test_add_and_close(self):
1202 # Verifying that closing a mailbox doesn't change added items

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
_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