import json
from typing import Any

import httpx
import pytest

from linwheel import LinWheel


def make_mock_transport(
    status_code: int = 200,
    body: dict[str, Any] | None = None,
) -> httpx.MockTransport:
    response_body = body or {}

    def handler(request: httpx.Request) -> httpx.Response:
        return httpx.Response(
            status_code=status_code,
            json=response_body,
        )

    return httpx.MockTransport(handler)


@pytest.fixture
def api_key() -> str:
    return "lw_sk_test1234567890abcdef"


@pytest.fixture
def base_url() -> str:
    return "https://test.linwheel.io"
