fix(config): leave get_config to NAPALM's stub #22

Merged
christianmanivong merged 1 commits from fix/get-config-unsupported into main 2026-11-12 14:31:07 +00:00
2 changed files with 9 additions and 13 deletions

No files matched your search

-10
View File
@@ -399,16 +399,6 @@ class ZyxelVMGDriver(ResidentialGatewayDriver):
"""Not supported on Zyxel VMG."""
return {}
def get_config(
self,
retrieve: str = "all",
full: bool = False,
sanitized: bool = False,
format: str = "text",
) -> dict[str, Any]:
"""Not supported on Zyxel VMG."""
return {}
def get_environment(self) -> dict[str, Any]:
"""Not supported on Zyxel VMG."""
return {}
+9 -3
View File
@@ -423,9 +423,15 @@ class TestZyxelVMGDriver:
assert result["MyWiFi"]["encryption"] == "WPA2"
assert result["MyWiFi"]["clients"] == 3
def test_get_config(self):
self._setup_mocked_http()
assert self.driver.get_config() == {}
def test_get_config_is_left_to_napalms_stub(self):
"""A VMG has no configuration export: the driver must not override
get_config, so NAPALM's stub tells callers it is not supported. A stub
returning {} read as a backup that came back empty."""
from napalm.base import NetworkDriver
assert ZyxelVMGDriver.get_config is NetworkDriver.get_config
with pytest.raises(NotImplementedError):
self.driver.get_config()
def test_cli(self):
self._setup_mocked_http()