41 lines
784 B
Python
41 lines
784 B
Python
# -*- coding: utf-8 -*-
|
|
# bthlabs-jsonrpc-core | (c) 2022-present Tomek Wójcik | MIT License
|
|
# type: ignore
|
|
from __future__ import annotations
|
|
|
|
from unittest import mock
|
|
|
|
import pytest
|
|
|
|
from bthlabs_jsonrpc_core.codecs import Codec
|
|
|
|
|
|
@pytest.fixture
|
|
def fake_custom_codec() -> mock.Mock:
|
|
return mock.Mock(spec=Codec)
|
|
|
|
|
|
@pytest.fixture
|
|
def single_call() -> dict:
|
|
return {
|
|
'jsonrpc': '2.0',
|
|
'id': 'test',
|
|
'method': 'system.list_methods',
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def batch_calls() -> list:
|
|
return [
|
|
{
|
|
'jsonrpc': '2.0',
|
|
'id': 'test',
|
|
'method': 'system.list_methods',
|
|
},
|
|
{
|
|
'jsonrpc': '2.0',
|
|
'id': 'test2',
|
|
'method': 'system.list_methods',
|
|
},
|
|
]
|