diff --git a/pypeman/plugins/tests/test_remoteadmin.py b/pypeman/plugins/tests/test_remoteadmin.py index e6c05d0..e12463c 100644 --- a/pypeman/plugins/tests/test_remoteadmin.py +++ b/pypeman/plugins/tests/test_remoteadmin.py @@ -167,15 +167,15 @@ async def test_search_messages_with_rtext_flt(self, webremoteclient): assert json_resp['messages'][0]['id'] == self.msg3.uuid async def test_replay_message(self, webremoteclient): + assert await self.chan.message_store.total() == 4 resp = await webremoteclient.get(f"/channels/{self.chan_name}/messages/{self.msg3.uuid}/replay") assert resp.status == 200 json_resp = json.loads(await resp.text()) - assert len(json_resp) == 1 assert await self.chan.message_store.total() == 5 # Clean - await self.chan.message_store.delete(json_resp[0]["uuid"]) + await self.chan.message_store.delete(json_resp["uuid"]) async def test_push_message(self, webremoteclient): pass # actually not implemented diff --git a/pypeman/remoteadmin.py b/pypeman/remoteadmin.py index 8cab7c7..9ef466e 100644 --- a/pypeman/remoteadmin.py +++ b/pypeman/remoteadmin.py @@ -255,6 +255,8 @@ def send_command(self, command, args=None): """ if args is None: args = [] + if not isinstance(args, list): + args = [args] return self.loop.run_until_complete(self._send_command(command, args)) async def _send_command(self, command, args): @@ -262,7 +264,7 @@ async def _send_command(self, command, args): Asynchronous version of command sending """ async with websockets.connect(self.url) as ws: - await ws.send(request_json(command, [*args])) + await ws.send(request_json(command, *args)) response = await ws.recv() parsed_response = parse_json(response) return parsed_response.result