'Test the bookmark save/restore feature'

def test_bookmarks_save_restore(self):

    bookmark = {u'path': u'/tmp/python/thinks/this/exists', u'name': u'exists'}
    def mock_verify(path):
        return (path == bookmark[u'path'])
    settings = self.new_settings()
    settings.add_bookmark(bookmark[u'path'], bookmark[u'name'])
    settings.save()
    settings = self.new_settings(verify=mock_verify)
    bookmarks = settings.bookmarks
    self.assertEqual(len(settings.bookmarks), 1)
    self.assertTrue((bookmark in bookmarks))
    settings.remove_bookmark(bookmark[u'path'], bookmark[u'name'])
    bookmarks = settings.bookmarks
    self.assertEqual(len(bookmarks), 0)
    self.assertFalse((bookmark in bookmarks))
