Exemplo n.º 1
0
def webserver(request, configuration_loaded, init_session):
    with TestClient(
            create_app(
                RegistryManager.get(
                    Configuration.get("db_name"),
                    loadwithoutmigration=True,
                ))) as client:
        yield client
Exemplo n.º 2
0
def asgi() -> None:
    """uvicorn ASGI dev server"""

    load_init_function_from_entry_points()
    argv: List[str] = copy(sys.argv)
    Configuration.load("uvicorn")
    sys.argv = argv
    configuration_post_load()
    BlokManager.load()

    kwargs = {
        "app": create_app(preload_database(loadwithoutmigration=False)),
        "host": Configuration.get("host"),
        "port": Configuration.get("port"),
        # "uds": uds,
        # "fd": fd,
        # "loop": loop,
        # "http": http,
        # "ws": ws,
        # "lifespan": lifespan,
        # "env_file": env_file,
        # "log_config": LOGGING_CONFIG if log_config is None else log_config,
        # "log_level": log_level,
        # "access_log": access_log,
        # "interface": interface,
        # "debug": debug,
        # "reload": reload,
        # "reload_dirs": reload_dirs if reload_dirs else None,
        # "workers": workers,
        # "proxy_headers": proxy_headers,
        # "forwarded_allow_ips": forwarded_allow_ips,
        # "root_path": root_path,
        # "limit_concurrency": limit_concurrency,
        # "backlog": backlog,
        # "limit_max_requests": limit_max_requests,
        # "timeout_keep_alive": timeout_keep_alive,
        # "ssl_keyfile": ssl_keyfile,
        # "ssl_certfile": ssl_certfile,
        # "ssl_version": ssl_version,
        # "ssl_cert_reqs": ssl_cert_reqs,
        # "ssl_ca_certs": ssl_ca_certs,
        # "ssl_ciphers": ssl_ciphers,
        # "headers": list([header.split(":") for header in headers]),
        # "use_colors": use_colors,
    }

    run(**kwargs)
Exemplo n.º 3
0
 def load(self) -> "FastAPI":
     BlokManager.load(entry_points=("bloks", ))
     return create_app(preload_database())
Exemplo n.º 4
0
 def webserver_test_blok(self, registry_testblok):
     registry_testblok.upgrade(install=("test-fastapi-blok1",))
     with TestClient(create_app(registry_testblok)) as client:
         yield client
Exemplo n.º 5
0
 def webserver(self, registry_testblok):
     with TestClient(create_app(registry_testblok)) as client:
         yield client