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.
This commit is contained in:
Peter Hutterer 2023-02-28 13:24:47 +10:00
parent 8ea6b81f40
commit 2e1babbb84

View file

@ -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