import pytest
from unittest.mock import MagicMock, patch


@pytest.fixture
def mock_ch_client():
    """Mock ClickHouse client."""
    client = MagicMock()
    client.query.return_value = MagicMock(result_rows=[])
    client.command.return_value = None
    return client


@pytest.fixture(autouse=False)
def mock_get_client(mock_ch_client):
    with patch("ja4_common.clickhouse.get_client", return_value=mock_ch_client):
        yield mock_ch_client
