python-client: fix test.py for current rpc_reader and PluginRemote APIs (#2087)

test.py has drifted from the server code it exercises: RpcTransport
implementations must provide writeSerialized (rpc.py no longer calls
writeJSON), and PluginRemote.__init__ now takes a ClusterSetup as its
first argument instead of the peer. Verified against a live scrypted
server (connects and enumerates devices).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Raman Gupta
2026-07-27 15:53:35 -04:00
committed by GitHub
parent 1c983f55bf
commit 5945b17c5e

View File

@@ -52,7 +52,7 @@ class EioRpcTransport(rpc_reader.RpcTransport):
asyncio.run_coroutine_threadsafe(send(), self.loop)
def writeJSON(self, json, reject):
def writeSerialized(self, json, reject):
return self.writeBuffer(json, reject)
@@ -96,8 +96,9 @@ async def connect_scrypted_client(
peer.params["print"] = print
def callback(api, pluginId, hostInfo):
cluster_setup = plugin_remote.ClusterSetup(transport.loop, peer)
remote = plugin_remote.PluginRemote(
peer, api, pluginId, hostInfo, transport.loop
cluster_setup, api, pluginId, hostInfo, transport.loop
)
wrapped = remote.setSystemState