Skip to content

Commit b61f1c8

Browse files
committed
test: fix TypeError: non-ordered lists cannot be accessed by index
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent f185458 commit b61f1c8

File tree

1 file changed

+2
-1
lines changed
  • test/case/infix_firewall/wan-dmz-lan

1 file changed

+2
-1
lines changed

test/case/infix_firewall/wan-dmz-lan/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ def debug(msg):
181181
assert wan_zone["action"] == "drop"
182182
assert wan_if in wan_zone["interface"]
183183
assert len(wan_zone["port-forward"]) == 1
184-
pf = wan_zone["port-forward"][0]
184+
# Access port-forward by iterating over the keyed list
185+
pf = next(iter(wan_zone["port-forward"]))
185186
assert pf["lower"] == 8080
186187
assert pf["to"]["addr"] == DMZ_SERVER_IP
187188
assert pf["to"]["port"] == 80

0 commit comments

Comments
 (0)