def create_app(self):
     config._set_connection_string('sqlite:///test.db')
     app = Flask('test')
     app.register_blueprint(FDPLoaderBlueprint, url_prefix='/loader')
     app.config['DEBUG'] = True
     app.config['TESTING'] = True
     app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = True
     return app
 def setUp(self):
     """
     Set-up a dummy DB for the test
     :return:
     """
     self.es = Elasticsearch(hosts=[LOCAL_ELASTICSEARCH])
     try:
         self.es.indices.delete(index='packages')
     except NotFoundError:
         pass
     self.runner = CliRunner()
     self.dbfilename = 'test.db'
     config._set_connection_string('sqlite:///test.db')
 def setUp(self):
     """
     Set-up a dummy DB for the tests
     :return:
     """
     self.es = Elasticsearch(hosts=[LOCAL_ELASTICSEARCH])
     try:
         self.es.indices.delete(index="packages")
     except NotFoundError:
         pass
     config._set_connection_string("sqlite:///:memory:")
     fdp_loader = loader.FDPLoader(config.get_engine())
     fdp_loader.load_fdp_to_db(SAMPLE_PACKAGE)
 def setUp(self):
     """
     Set-up a dummy DB for the tests
     :return:
     """
     self.es = Elasticsearch(hosts=[LOCAL_ELASTICSEARCH])
     try:
         self.es.indices.delete(index='packages')
     except NotFoundError:
         pass
     self.dbfilename = os.path.join(os.path.abspath('.'), 'test.db')
     self.connection_string = 'sqlite:///' + self.dbfilename
     config._set_connection_string(self.connection_string)
     self.loader = loader.FDPLoader()
from babbage_fiscal import cli, config
config._set_connection_string('sqlite:///:memory:')
cli()