def setUpClass(cls): cli.load_examples(load_test_data=True) utils.init(caravel) cls.table_ids = { tbl.table_name: tbl.id for tbl in (db.session.query(models.SqlaTable).all()) }
def __init__(self, *args, **kwargs): super(CaravelTestCase, self).__init__(*args, **kwargs) self.client = app.test_client() utils.init(caravel) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user('admin', 'admin', ' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') gamma = appbuilder.sm.find_user('gamma') if not gamma: appbuilder.sm.add_user('gamma', 'gamma', 'user', '*****@*****.**', appbuilder.sm.find_role('Gamma'), password='******') alpha = appbuilder.sm.find_user('alpha') if not alpha: appbuilder.sm.add_user('alpha', 'alpha', 'user', '*****@*****.**', appbuilder.sm.find_role('Alpha'), password='******') utils.init(caravel)
def __init__(self, *args, **kwargs): super(CaravelTestCase, self).__init__(*args, **kwargs) self.client = app.test_client() utils.init(caravel) admin = appbuilder.sm.find_user("admin") if not admin: appbuilder.sm.add_user( "admin", "admin", " user", "*****@*****.**", appbuilder.sm.find_role("Admin"), password="******" ) gamma = appbuilder.sm.find_user("gamma") if not gamma: appbuilder.sm.add_user( "gamma", "gamma", "user", "*****@*****.**", appbuilder.sm.find_role("Gamma"), password="******" ) alpha = appbuilder.sm.find_user("alpha") if not alpha: appbuilder.sm.add_user( "alpha", "alpha", "user", "*****@*****.**", appbuilder.sm.find_role("Alpha"), password="******" ) utils.init(caravel)
def __init__(self, *args, **kwargs): super(CaravelTestCase, self).__init__(*args, **kwargs) self.client = app.test_client() utils.init(caravel) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user( 'admin', 'admin',' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') gamma = appbuilder.sm.find_user('gamma') if not gamma: appbuilder.sm.add_user( 'gamma', 'gamma', 'user', '*****@*****.**', appbuilder.sm.find_role('Gamma'), password='******') alpha = appbuilder.sm.find_user('alpha') if not alpha: appbuilder.sm.add_user( 'alpha', 'alpha', 'user', '*****@*****.**', appbuilder.sm.find_role('Alpha'), password='******') utils.init(caravel)
def setUpClass(cls): cli.load_examples(load_test_data=True) utils.init(caravel) cls.table_ids = {tbl.table_name: tbl.id for tbl in ( db.session .query(models.SqlaTable) .all() )}
def __init__(self, *args, **kwargs): super(CoreTests, self).__init__(*args, **kwargs) self.table_ids = { tbl.table_name: tbl.id for tbl in (db.session.query(models.SqlaTable).all()) } utils.init(caravel) self.load_examples()
def __init__(self, *args, **kwargs): super(CoreTests, self).__init__(*args, **kwargs) self.table_ids = {tbl.table_name: tbl.id for tbl in ( db.session .query(models.SqlaTable) .all() )} utils.init(caravel) self.load_examples()
def __init__(self, *args, **kwargs): super(CaravelTests, self).__init__(*args, **kwargs) self.client = app.test_client() role_admin = appbuilder.sm.find_role('Admin') user = appbuilder.sm.find_user('admin') if not user: appbuilder.sm.add_user('admin', 'admin', ' user', '*****@*****.**', role_admin, 'general') utils.init(caravel) self.load_examples()
def __init__(self, *args, **kwargs): super(CaravelTests, self).__init__(*args, **kwargs) self.client = app.test_client() role_admin = appbuilder.sm.find_role('Admin') user = appbuilder.sm.find_user('admin') if not user: appbuilder.sm.add_user( 'admin', 'admin',' user', '*****@*****.**', role_admin, 'general') utils.init(caravel) self.load_examples()
def __init__(self, *args, **kwargs): super(CaravelTestCase, self).__init__(*args, **kwargs) self.client = app.test_client() self.maxDiff = None utils.init(caravel) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user('admin', 'admin', ' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') gamma = appbuilder.sm.find_user('gamma') if not gamma: appbuilder.sm.add_user('gamma', 'gamma', 'user', '*****@*****.**', appbuilder.sm.find_role('Gamma'), password='******') alpha = appbuilder.sm.find_user('alpha') if not alpha: appbuilder.sm.add_user('alpha', 'alpha', 'user', '*****@*****.**', appbuilder.sm.find_role('Alpha'), password='******') # create druid cluster and druid datasources session = db.session cluster = session.query( models.DruidCluster).filter_by(cluster_name="druid_test").first() if not cluster: cluster = models.DruidCluster(cluster_name="druid_test") session.add(cluster) session.commit() druid_datasource1 = models.DruidDatasource( datasource_name='druid_ds_1', cluster_name='druid_test') session.add(druid_datasource1) druid_datasource2 = models.DruidDatasource( datasource_name='druid_ds_2', cluster_name='druid_test') session.add(druid_datasource2) session.commit() utils.init(caravel)
def setUpClass(cls): try: os.remove(app.config.get('SQL_CELERY_DB_FILE_PATH')) except OSError as e: app.logger.warn(str(e)) try: os.remove(app.config.get('SQL_CELERY_RESULTS_DB_FILE_PATH')) except OSError as e: app.logger.warn(str(e)) utils.init(caravel) worker_command = BASE_DIR + '/bin/caravel worker' subprocess.Popen( worker_command, shell=True, stdout=subprocess.PIPE) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user( 'admin', 'admin', ' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') cli.load_examples(load_test_data=True)
def __init__(self, *args, **kwargs): if ( self.requires_examples and not os.environ.get('SOLO_TEST') and not os.environ.get('examples_loaded') ): cli.load_examples(load_test_data=True) utils.init(caravel) os.environ['examples_loaded'] = '1' super(CaravelTestCase, self).__init__(*args, **kwargs) self.client = app.test_client() self.maxDiff = None utils.init(caravel) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user( 'admin', 'admin', ' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') gamma = appbuilder.sm.find_user('gamma') if not gamma: appbuilder.sm.add_user( 'gamma', 'gamma', 'user', '*****@*****.**', appbuilder.sm.find_role('Gamma'), password='******') alpha = appbuilder.sm.find_user('alpha') if not alpha: appbuilder.sm.add_user( 'alpha', 'alpha', 'user', '*****@*****.**', appbuilder.sm.find_role('Alpha'), password='******') # create druid cluster and druid datasources session = db.session cluster = session.query(models.DruidCluster).filter_by( cluster_name="druid_test").first() if not cluster: cluster = models.DruidCluster(cluster_name="druid_test") session.add(cluster) session.commit() druid_datasource1 = models.DruidDatasource( datasource_name='druid_ds_1', cluster_name='druid_test' ) session.add(druid_datasource1) druid_datasource2 = models.DruidDatasource( datasource_name='druid_ds_2', cluster_name='druid_test' ) session.add(druid_datasource2) session.commit() utils.init(caravel)
def setUpClass(cls): try: os.remove(app.config.get('SQL_CELERY_DB_FILE_PATH')) except OSError as e: app.logger.warn(str(e)) try: os.remove(app.config.get('SQL_CELERY_RESULTS_DB_FILE_PATH')) except OSError as e: app.logger.warn(str(e)) utils.init(caravel) worker_command = BASE_DIR + '/bin/caravel worker' subprocess.Popen(worker_command, shell=True, stdout=subprocess.PIPE) admin = appbuilder.sm.find_user('admin') if not admin: appbuilder.sm.add_user('admin', 'admin', ' user', '*****@*****.**', appbuilder.sm.find_role('Admin'), password='******') cli.load_examples(load_test_data=True)
def test_init(self): utils.init(caravel)