chia-blockchain/tests/core/test_daemon_rpc.py
Earle Lowe 0a0c8920ff
Add a daemon heartbeat setting to config.yaml (#13886)
* make daemon heartbeat configurable and increase default

* Fix up daemon rpc test

* Fix dumb error with parameters

* Restore formatting

* Various updates from feedback

* Update tests/core/test_daemon_rpc.py

use config value for heartbeat

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* black fixes

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-06 11:55:20 -06:00

26 lines
711 B
Python

from __future__ import annotations
import pytest
from chia import __version__
from chia.daemon.client import connect_to_daemon
class TestDaemonRpc:
@pytest.mark.asyncio
async def test_get_version_rpc(self, get_daemon, bt):
ws_server = get_daemon
config = bt.config
client = await connect_to_daemon(
config["self_hostname"],
config["daemon_port"],
50 * 1000 * 1000,
bt.get_daemon_ssl_context(),
heartbeat=config["daemon_heartbeat"],
)
response = await client.get_version()
assert response["data"]["success"]
assert response["data"]["version"] == __version__
ws_server.stop()