Coverage for tests/daemon/rpc/base_test_monero_daemon_rpc.py: 100%
23 statements
« prev ^ index » next coverage.py v7.17.3, created at 2026-11-22 19:49 +0000
« prev ^ index » next coverage.py v7.17.3, created at 2026-11-22 19:49 +0000
1from __future__ import annotations
3import logging
5import pytest
6from monero import MoneroDaemonRpc, MoneroWalletRpc
7from typing_extensions import override
9from utils import BaseTestClass, BinaryBlockContext, IntegrationTestUtils, TestUtils as Utils, WalletType
11logger: logging.Logger = logging.getLogger("TestMoneroDaemonRpc")
14class BaseTestMoneroDaemonRpc(BaseTestClass):
15 """Rpc daemon integration tests."""
17 BINARY_BLOCK_CTX: BinaryBlockContext = BinaryBlockContext()
19 _test_wallet: MoneroWalletRpc | None = None
21 @override
22 def before_all(self) -> None:
23 # setup wallet rpc for tests
24 IntegrationTestUtils.setup(WalletType.RPC)
26 @pytest.fixture(scope="class")
27 @classmethod
28 def daemon(cls) -> MoneroDaemonRpc:
29 """Test rpc daemon instance"""
30 return Utils.get_daemon_rpc()
32 @pytest.fixture(scope="class")
33 @classmethod
34 def wallet(cls) -> MoneroWalletRpc:
35 """Test rpc wallet instance"""
36 if cls._test_wallet is None:
37 cls._test_wallet = Utils.get_wallet_rpc()
39 return cls._test_wallet