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

1from __future__ import annotations 

2 

3import logging 

4 

5import pytest 

6from monero import MoneroDaemonRpc, MoneroWalletRpc 

7from typing_extensions import override 

8 

9from utils import BaseTestClass, BinaryBlockContext, IntegrationTestUtils, TestUtils as Utils, WalletType 

10 

11logger: logging.Logger = logging.getLogger("TestMoneroDaemonRpc") 

12 

13 

14class BaseTestMoneroDaemonRpc(BaseTestClass): 

15 """Rpc daemon integration tests.""" 

16 

17 BINARY_BLOCK_CTX: BinaryBlockContext = BinaryBlockContext() 

18 

19 _test_wallet: MoneroWalletRpc | None = None 

20 

21 @override 

22 def before_all(self) -> None: 

23 # setup wallet rpc for tests 

24 IntegrationTestUtils.setup(WalletType.RPC) 

25 

26 @pytest.fixture(scope="class") 

27 @classmethod 

28 def daemon(cls) -> MoneroDaemonRpc: 

29 """Test rpc daemon instance""" 

30 return Utils.get_daemon_rpc() 

31 

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() 

38 

39 return cls._test_wallet