Exemple #1
0
    def setup(self):
        # this is needed to give each test
        # its own app
        config = os.getenv('TEST_CONFIG')
        if config is not None:
            app = create_app(config)
        else:
            app = create_app(__name__)

        with app.app_context():
            from eudat_http_api.registration.models import db
            db.create_all()

        self.app = app
        self.client = app.test_client()

        self.storage_config = app.config['STORAGE']

        if app.config['STORAGE'] == 'local':
            create_local_urls(self.url_list)
        elif app.config['STORAGE'] == 'irods':
            self.irods_config = (self.app.config['RODSHOST'],
                                 self.app.config['RODSPORT'],
                                 self.app.config['RODSZONE']
                                 )
            with self.app.app_context():
                create_irods_urls(self.url_list,
                                  self.irods_config)
    def setup(self):
        config = os.getenv('TEST_CONFIG')
        if config is not None:
            app = create_app(config)
        else:
            app = create_app(__name__)
        self.app = app
        with app.app_context():
            from eudat_http_api.registration.models import db
            db.create_all()

        self.client = app.test_client()
Exemple #3
0
from eudat_http_api.registration.models import db
from eudat_http_api import create_app

app = create_app('config')

with app.app_context():
    db.create_all()
Exemple #4
0
 def setUp(self):
     app = create_app('test_config')
     self.app = app
     self.client = app.test_client()
     db.create_all()
     registration_worker.set_config(app.config)