The three methods only raised NotImplementedError. napalm-device-types declares them on SwitchDriver for type checking only, so a driver that cannot carry them out is meant not to have them; netOrk reads the capability from the method being callable and offered "Add VLAN" and the port VLAN editor on Plus switches, which then failed. BREAKING CHANGE: NetgearPlusDriver has no set_vlan, delete_vlan or set_interface attribute any more. Closes #9
19 lines
638 B
Python
19 lines
638 B
Python
"""Netgear Plus only has the methods it can carry out.
|
|
|
|
An application reads a capability from the method being there: netOrk offers
|
|
"Add VLAN" and the port VLAN editor when ``set_vlan`` / ``set_interface`` are
|
|
callable (#9). A method that only raises NotImplementedError
|
|
made the HTTP-only Plus switches look able to do it.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from napalm_netgear.netgear_plus import NetgearPlusDriver
|
|
|
|
|
|
@pytest.mark.parametrize("method", ["set_vlan", "delete_vlan", "set_interface"])
|
|
def test_plus_has_no_vlan_or_port_writes(method):
|
|
assert not callable(getattr(NetgearPlusDriver, method, None))
|