chia-blockchain/tests/util/rpc.py
Kyle Altendorf 3b084a165b
configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00

22 lines
692 B
Python

from __future__ import annotations
from chia.rpc.rpc_client import RpcClient
from chia.rpc.rpc_server import RpcApiProtocol
async def validate_get_routes(client: RpcClient, api: RpcApiProtocol) -> None:
routes_client = (await client.fetch("get_routes", {}))["routes"]
assert len(routes_client) > 0
routes_api = list(api.get_routes().keys())
# TODO: avoid duplication of RpcServer.get_routes()
routes_server = [
"/get_connections",
"/open_connection",
"/close_connection",
"/stop_node",
"/get_routes",
"/healthz",
]
assert len(routes_api) > 0
assert sorted(routes_client) == sorted(routes_api + routes_server)