fix(tests): correct ADDRESSES_RESPONSE fixture shape in TestGetInterfacesIp
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:
@@ -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": [
|
||||||
|
|||||||
Reference in New Issue
Block a user