2022-06-04 08:41:53 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2024-01-15 20:20:10 +00:00
|
|
|
# type: ignore
|
2022-06-04 08:41:53 +00:00
|
|
|
from unittest import mock
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
from bthlabs_jsonrpc_core.registry import MethodRegistry
|
|
|
|
from bthlabs_jsonrpc_core.serializer import JSONRPCSerializer
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-01-15 20:20:10 +00:00
|
|
|
def fake_method_registry() -> mock.Mock:
|
2022-06-04 08:41:53 +00:00
|
|
|
return mock.Mock(spec=MethodRegistry)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-01-15 20:20:10 +00:00
|
|
|
def fake_handler() -> mock.Mock:
|
2022-06-04 08:41:53 +00:00
|
|
|
return mock.Mock()
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-01-15 20:20:10 +00:00
|
|
|
def fake_rpc_serializer() -> mock.Mock:
|
2022-06-04 08:41:53 +00:00
|
|
|
return mock.Mock(spec=JSONRPCSerializer)
|