# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"


import json
import aiohttp
import pytest
import virtool.app
import virtool.jobs.main
from typing import Optional
from aiohttp.web_routedef import RouteTableDef
from virtool.config.cls import Config
from virtool.utils import hash_key
    aiohttp_client,
    test_db_connection_string,
    redis_connection_string,
    pg_connection_string,
    pg_session,
    test_db_name,
):
    """A factory method for creating an aiohttp client which can authenticate with the API as a Job."""

    async def _spawn_job_client(
        authorize: bool = False,
        dev: bool = False,
        add_route_table: RouteTableDef = None,
    ):
        # Create a test job to use for authentication.
        if authorize:
            job_id, key = "test_job", "test_key"
            await dbi.jobs.insert_one(
                {
                    "_id": job_id,
                    "key": hash_key(key),
                }
            )

            # Create Basic Authentication header.
            auth = aiohttp.BasicAuth(login=f"job-{job_id}", password=key)
        else:
            auth = None

        app = await virtool.jobs.main.create_app(

# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"


# Path: tests/fixtures/client.py
import json
import aiohttp
import pytest
import virtool.app
import virtool.jobs.main
from typing import Optional
from aiohttp.web_routedef import RouteTableDef
from virtool.config.cls import Config
from virtool.utils import hash_key

    aiohttp_client,
    test_db_connection_string,
    redis_connection_string,
    pg_connection_string,
    pg_session,
    test_db_name,
):
    """A factory method for creating an aiohttp client which can authenticate with the API as a Job."""

    async def _spawn_job_client(
        authorize: bool = False,
        dev: bool = False,
        add_route_table: RouteTableDef = None,
    ):
        # Create a test job to use for authentication.
        if authorize:
            job_id, key = "test_job", "test_key"
            await dbi.jobs.insert_one(
                {
                    "_id": job_id,
                    "key": hash_key(key),
                }
            )

            # Create Basic Authentication header.
            auth = aiohttp.BasicAuth(login=f"job-{job_id}", password=key)
        else:
            auth = None

        app = await virtool.jobs.main.create_app(

            Config(