Skip to content

Commit 464c1cb

Browse files
committed
tests: minor cleanups for test_get_message_types
A few spacing fixes, and use a temporary for the command, mainly to avoid long lines. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
1 parent 2b7f5cc commit 464c1cb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/test_mctpd.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,19 +1259,25 @@ async def test_get_message_types(dbus, mctpd):
12591259
ep.eid = 12
12601260
iface = mctpd.system.interfaces[0]
12611261
await mctpd.system.add_route(mctpd.system.Route(ep.eid, 1, iface = iface))
1262-
await mctpd.system.add_neighbour(mctpd.system.Neighbour(iface, ep.lladdr, ep.eid))
1262+
await mctpd.system.add_neighbour(
1263+
mctpd.system.Neighbour(iface, ep.lladdr, ep.eid)
1264+
)
12631265

12641266
# Check default response when no responder registered
1265-
rsp = await ep.send_control(mctpd.network.mctp_socket, MCTPControlCommand(True, 0, 0x05, bytes([0x00])))
1267+
cmd = MCTPControlCommand(True, 0, 0x05, bytes([0x00]))
1268+
rsp = await ep.send_control(mctpd.network.mctp_socket, cmd)
12661269
assert rsp.hex(' ') == '00 05 00 01 00'
12671270

12681271
# Register spdm responder with a random version
12691272
mctp = await mctpd_mctp_base_iface_obj(dbus)
12701273
await mctp.call_register_type_support(5, [0xF1F2F3F4])
12711274

12721275
# Verify get message type response includes spdm
1273-
rsp = await ep.send_control(mctpd.network.mctp_socket, MCTPControlCommand(True, 0, 0x05, bytes([0x00])))
1276+
cmd = MCTPControlCommand(True, 0, 0x05, bytes([0x00]))
1277+
rsp = await ep.send_control(mctpd.network.mctp_socket, cmd)
12741278
assert rsp.hex(' ') == '00 05 00 02 00 05'
1279+
12751280
# Verify version passed in dbus call is responded back
1276-
rsp = await ep.send_control(mctpd.network.mctp_socket, MCTPControlCommand(True, 0, 0x04, bytes([0x05])))
1277-
assert rsp.hex(' ') == '00 04 00 01 f4 f3 f2 f1'
1281+
cmd = MCTPControlCommand(True, 0, 0x04, bytes([0x05]))
1282+
rsp = await ep.send_control(mctpd.network.mctp_socket, cmd)
1283+
assert rsp.hex(' ') == '00 04 00 01 f4 f3 f2 f1'

0 commit comments

Comments
 (0)