Exemple #1
0
def client():
    conf = Config.load(ROOT_CONFIG)
    app = Application(conf, log_level="ERROR", testing=True)
    app.config["TESTING"] = True
    client = app.app.test_client()
    client.application.redis.flushall()

    Task.objects.delete()

    yield client
Exemple #2
0
def auth_client():
    conf = Config.load(ROOT_CONFIG)
    conf.BASIC_AUTH_USERNAME = "******"
    conf.BASIC_AUTH_PASSWORD = "******"
    app = Application(conf, log_level="ERROR", testing=True)
    app.config["TESTING"] = True
    cli = app.app.test_client()
    cli.application.redis.flushall()

    Task.objects.delete()
    Job.objects.delete()

    yield cli
def worker():
    conf = Config.load(ROOT_CONFIG)
    app = Application(conf, log_level="ERROR", testing=True)
    app.config["TESTING"] = True
    cli = app.app.test_client()
    cli.application.redis.flushall()

    Task.objects.delete()
    Job.objects.delete()

    worker_instance = WorkerHandler(None,
                                    str(uuid4()),
                                    True,
                                    True,
                                    True,
                                    True,
                                    app.config,
                                    0,
                                    app=app)

    yield worker_instance
Exemple #4
0
 def load_config(self):
     # self.click.echo(f'Loading configuration from {self.config_path}...')
     self.config = Config.load(self.config_path)
Exemple #5
0
 def load_config(self):
     self.config = Config.load(self.config_path)