from unittest.mock import MagicMock

import pytest

from sqgen_risk.config import Settings

# Constants for testing
TEST_BASE_URL = "https://api.test.com"
TEST_TOKEN = "test-token-not-real"  # Not a real token, just for testing  # noqa: S105
TEST_EMAIL = "test@example.com"
TEST_PASSWORD = "test-password-not-real"  # Not a real password, just for testing  # noqa: S105


@pytest.fixture
def test_settings() -> Settings:
    """Return a test settings instance."""
    return Settings(BASE_URL=TEST_BASE_URL)


@pytest.fixture
def mock_session() -> MagicMock:
    """Create a mock session for testing the API client."""
    mock = MagicMock()
    return mock


@pytest.fixture
def mock_response(status_code: int = 200, json_data: dict | None = None, content: bytes | None = None) -> MagicMock:
    """Create a mock response for testing API calls."""
    mock = MagicMock()
    mock.status_code = status_code
    mock.json.return_value = json_data or {}
    mock.content = content or b""
    return mock
