From 2e1babbb84a37783e97cf99095ebfad560691919 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 28 Feb 2023 13:24:47 +1000 Subject: [PATCH] test: simplify results handling in the python tests No point appending the message header components to the results when we just ignore them later anyway. --- test/eiproto.py.tmpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/eiproto.py.tmpl b/test/eiproto.py.tmpl index c5e9ba3..74c3be8 100644 --- a/test/eiproto.py.tmpl +++ b/test/eiproto.py.tmpl @@ -207,8 +207,7 @@ class Interface: # logger.debug(f"unpacked {format} to {values}") results = [] - results.append(values.pop(0)) # id - results.append(values.pop(0)) # length | opcode + values = values[2:] # drop id, length | opcode # we had to insert the string length into the format, filter the # value for that out again. @@ -225,7 +224,7 @@ class Interface: results.append(values.pop(0)) # First two values are object_id and len|opcode - return (msglen, { name: value for name, value in zip(names, results[2:]) }) + return (msglen, { name: value for name, value in zip(names, results) }) def connect(self, event: str, callback: Callable): self.callbacks[event] = callback