# Path: tests/conftest.py
# DEFAULT_SERVER = "http://localhost:8888/v1"
# DEFAULT_AUTH = "user:pass"
# DEFAULT_EDITOR_AUTH = "editor:pass"
# DEFAULT_REVIEWER_AUTH = "reviewer:pass"
# DEFAULT_BUCKET = "main-workspace"
# DEFAULT_COLLECTION = "product-integrity"
# def pytest_addoption(parser):
# def server(request) -> str:
# def auth(request) -> Auth:
# def editor_auth(request) -> Auth:
# def reviewer_auth(request) -> Auth:
# def source_bucket(request) -> str:
# def source_collection(request) -> str:
# def keep_existing(request) -> bool:
# def make_client(
#     server: str, source_bucket: str, source_collection: str
# ) -> ClientFactory:
#     def _make_client(auth: Auth) -> AsyncClient:
# async def flush_default_collection(
#     make_client: ClientFactory,
#     auth: Auth,
#     source_bucket: str,
#     source_collection: str,
# ):
# def verify_url(request: FixtureRequest, base_url: str):
# def firefox_options(firefox_options: Options) -> Options:
# def selenium(selenium: WebDriver) -> WebDriver:
# def create_user(request_session: requests.Session, server: str, auth: Auth):


import os
import random
import pytest
import requests
from string import hexdigits
from typing import Dict, List
from kinto_http import AsyncClient, KintoException
from kinto_http.patch_type import JSONPatch
from kinto_remote_settings.signer.backends.local_ecdsa import ECDSASigner
from kinto_remote_settings.signer.serializer import canonical_json
from .conftest import Auth, ClientFactory
        data={"type": "logo"},
        if_not_exists=True,
    )

    with open("kinto-logo.svg", "rb") as attachment:
        assert requests.post(
            f"{server}{await client.get_endpoint('record', bucket='main-workspace', collection='product-integrity', id='logo')}/attachment",
            files={"attachment": attachment},
            auth=client.session.auth,
        ), "Issue updating an existing record to include an attachment"

    record = await client.get_record(
        id="logo", bucket="main-workspace", collection="product-integrity"
    )

    assert record
    assert "data" in record
    assert "attachment" in record["data"]


async def test_signer_plugin_capabilities(make_client: ClientFactory, auth: Auth):
    client = make_client(auth)
    capability = (await client.server_info())["capabilities"]["signer"]
    assert capability["group_check_enabled"]
    assert capability["to_review_enabled"]


async def test_signer_plugin_full_workflow(
    make_client: ClientFactory,
    auth: Auth,

# Path: tests/conftest.py
# DEFAULT_SERVER = "http://localhost:8888/v1"
# DEFAULT_AUTH = "user:pass"
# DEFAULT_EDITOR_AUTH = "editor:pass"
# DEFAULT_REVIEWER_AUTH = "reviewer:pass"
# DEFAULT_BUCKET = "main-workspace"
# DEFAULT_COLLECTION = "product-integrity"
# def pytest_addoption(parser):
# def server(request) -> str:
# def auth(request) -> Auth:
# def editor_auth(request) -> Auth:
# def reviewer_auth(request) -> Auth:
# def source_bucket(request) -> str:
# def source_collection(request) -> str:
# def keep_existing(request) -> bool:
# def make_client(
#     server: str, source_bucket: str, source_collection: str
# ) -> ClientFactory:
#     def _make_client(auth: Auth) -> AsyncClient:
# async def flush_default_collection(
#     make_client: ClientFactory,
#     auth: Auth,
#     source_bucket: str,
#     source_collection: str,
# ):
# def verify_url(request: FixtureRequest, base_url: str):
# def firefox_options(firefox_options: Options) -> Options:
# def selenium(selenium: WebDriver) -> WebDriver:
# def create_user(request_session: requests.Session, server: str, auth: Auth):


# Path: tests/integration_test.py
import os
import random
import pytest
import requests
from string import hexdigits
from typing import Dict, List
from kinto_http import AsyncClient, KintoException
from kinto_http.patch_type import JSONPatch
from kinto_remote_settings.signer.backends.local_ecdsa import ECDSASigner
from kinto_remote_settings.signer.serializer import canonical_json
from .conftest import Auth, ClientFactory

        data={"type": "logo"},
        if_not_exists=True,
    )

    with open("kinto-logo.svg", "rb") as attachment:
        assert requests.post(
            f"{server}{await client.get_endpoint('record', bucket='main-workspace', collection='product-integrity', id='logo')}/attachment",
            files={"attachment": attachment},
            auth=client.session.auth,
        ), "Issue updating an existing record to include an attachment"

    record = await client.get_record(
        id="logo", bucket="main-workspace", collection="product-integrity"
    )

    assert record
    assert "data" in record
    assert "attachment" in record["data"]


async def test_signer_plugin_capabilities(make_client: ClientFactory, auth: Auth):
    client = make_client(auth)
    capability = (await client.server_info())["capabilities"]["signer"]
    assert capability["group_check_enabled"]
    assert capability["to_review_enabled"]


async def test_signer_plugin_full_workflow(
    make_client: ClientFactory,
    auth: Auth,

    editor_auth: Auth,