def test_storage_initializes(self): config = {'STORAGE_TYPE': 'file'} types = {'file': FakeUserStorage} factory = UserStorageFactory(storage_types=types) storage = factory.get_storage(config) self.assertTrue(isinstance(storage, FileUserStorage)) self.assertTrue(storage.initialized)
def build_app(app_name): '''Build the application and extend it with various services.''' app = MarkWikiApp(app_name) if not app.is_bootstrapped(): print('This appears to be a new MarkWiki. Adding initial content ...') util.bootstrap(app) # Extend the app with the search engine. app.search_engine = SearchEngine(app.config['MARKWIKI_HOME']) if not app.search_engine.has_index(): app.search_engine.create_index(app.config['WIKI_PATH']) user_storage_factory = UserStorageFactory() app.user_storage = user_storage_factory.get_storage(app.config) return app
def setUp(self): self.factory = UserStorageFactory()