Test Python Package / unit-tests (pull_request) Successful in 12s
Code Quality Pipeline / code-quality (pull_request) Successful in 19s
PR Title Check / check-title (pull_request) Successful in 31s
Test Python Package / integration-tests (pull_request) Successful in 23s
Test Python Package / coverage-report (pull_request) Successful in 10s
Route Python hooks through uv run with versions pinned in uv.lock, add explicit Ruff settings, and extend the dependency bot to run pre-commit autoupdate. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
834 B
Python
28 lines
834 B
Python
"""Unit test fixtures for mocked adapters."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from minio import Minio
|
|
import pytest
|
|
import redis
|
|
|
|
from python_repositories.adapters.minio_adapter import MinioAdapter
|
|
from python_repositories.adapters.redis_adapter import RedisAdapter
|
|
from tests.conftest import TEST_MINIO_CONFIG, TEST_REDIS_CONFIG
|
|
|
|
|
|
@pytest.fixture
|
|
def redis_adapter() -> RedisAdapter:
|
|
"""Provide a RedisAdapter with an injected mock client."""
|
|
mock_client = MagicMock(spec=redis.Redis)
|
|
return RedisAdapter(config=TEST_REDIS_CONFIG, client=mock_client)
|
|
|
|
|
|
@pytest.fixture
|
|
def minio_adapter() -> MinioAdapter:
|
|
"""Provide a MinioAdapter with an injected mock client."""
|
|
mock_client = MagicMock(spec=Minio)
|
|
return MinioAdapter(config=TEST_MINIO_CONFIG, client=mock_client)
|