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

Method test_get_folder

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

Source from the content-addressed store, hash-verified

1348 set(('one', 'two', 'three')))
1349
1350 def test_get_folder(self):
1351 # Open folders
1352 def dummy_factory (s):
1353 return None
1354 self._box = self._factory(self._path, dummy_factory)
1355
1356 new_folder = self._box.add_folder('foo.bar')
1357 folder0 = self._box.get_folder('foo.bar')
1358 folder0.add(self._template % 'bar')
1359 self.assertTrue(os.path.isdir(os.path.join(self._path, 'foo.bar')))
1360 folder1 = self._box.get_folder('foo.bar')
1361 self.assertEqual(folder1.get_string(folder1.keys()[0]),
1362 self._template % 'bar')
1363
1364 # Test for bug #1569790: verify that folders returned by .get_folder()
1365 # use the same factory function.
1366 self.assertIs(new_folder._factory, self._box._factory)
1367 self.assertIs(folder0._factory, self._box._factory)
1368
1369 def test_add_and_remove_folders(self):
1370 # Delete folders

Callers

nothing calls this directly

Calls 11

_factoryMethod · 0.80
assertTrueMethod · 0.80
add_folderMethod · 0.45
get_folderMethod · 0.45
addMethod · 0.45
isdirMethod · 0.45
joinMethod · 0.45
assertEqualMethod · 0.45
get_stringMethod · 0.45
keysMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected