"""Shared fixtures — the FastAPI app wired to the in-memory ``fake`` provider.

The fake provider needs no credentials and keeps all state in memory, so the
whole route surface is exercisable offline. ``client`` and ``provider`` share the
same instance, so a test can assert provider state after driving the HTTP API.
"""

from __future__ import annotations

from typing import TYPE_CHECKING

import pytest
from fastapi.testclient import TestClient
from mgf.cloud.providers import get_provider

from mgf.cloud_web.web import create_app

if TYPE_CHECKING:
    from mgf.cloud.providers.base import CloudProvider


@pytest.fixture
def provider() -> CloudProvider:
    return get_provider("fake")


@pytest.fixture
def client(provider: CloudProvider) -> TestClient:
    return TestClient(create_app(provider))
