fix(tests): correct ADDRESSES_RESPONSE fixture shape in TestGetInterfacesIp
CI / test (3.10) (push) Failing after 19s
CI / test (3.11) (push) Failing after 7s
CI / test (3.12) (push) Failing after 7s
CI / test (3.9) (push) Failing after 7s

Verified against a live OPNsense 24.7 instance: GET
/api/interfaces/overview/export returns a bare list of interface dicts
keyed by "device" with CIDR "addr4"/"addr6" strings, matching what
get_interfaces_ip() already parses. The fixture's "items"/"interface"/
"address"/"prefix" shape never matched, so all four TestGetInterfacesIp
tests failed regardless of driver correctness.
This commit is contained in:
Christian Manivong
2026-07-24 10:26:01 +02:00
parent 8d3c443159
commit 1f29d9d57d
+9 -6
View File
@@ -61,13 +61,16 @@ INTERFACES_RESPONSE = {
] ]
} }
ADDRESSES_RESPONSE = { # Real shape confirmed against a live OPNsense 24.7 instance's
"items": [ # GET /api/interfaces/overview/export (see issue #14): a bare top-level list
{"interface": "em0", "address": "192.0.2.10", "prefix": 24}, # of interface dicts, addressed via "device" and CIDR "addr4"/"addr6"
{"interface": "em0", "address": "2001:db8::1", "prefix": 64}, # strings — not the "items"/"interface"/"address"/"prefix" shape this
{"interface": "em1", "address": "203.0.113.5", "prefix": 30}, # fixture previously assumed, which never matched get_interfaces_ip()'s
# actual parsing and made all four TestGetInterfacesIp tests fail.
ADDRESSES_RESPONSE = [
{"device": "em0", "addr4": "192.0.2.10/24", "addr6": "2001:db8::1/64"},
{"device": "em1", "addr4": "203.0.113.5/30", "addr6": ""},
] ]
}
ARP_RESPONSE = { ARP_RESPONSE = {
"arp": [ "arp": [