Confirm equality of client and server RPC routes (#11765)

* Confirm equality of client and server RPC routes

* Update rpc.py

* hints

* Update rpc.py

* Update mypy.ini

* Update rpc_server.py

* Update tests/util/rpc.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
This commit is contained in:
Kyle Altendorf
2022-09-26 11:18:46 -05:00
committed by GitHub
co-authored by dustinface
parent 23ff56579a
commit 8436e6a17a
2 changed files with 5 additions and 4 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -3
View File
@@ -2,17 +2,18 @@ from chia.rpc.rpc_client import RpcClient
from chia.rpc.rpc_server import RpcApiProtocol
async def validate_get_routes(client: RpcClient, api: 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
for route in routes_api + routes_server:
assert route in routes_client
assert sorted(routes_client) == sorted(routes_api + routes_server)