feat: TYPE_LABEL = "Storage" replaces storage_device = True flag
The TYPE_LABEL attribute on the base class hierarchy is now the canonical way for drivers to declare their device category. The storage_device sentinel flag is removed — classification is determined by reading TYPE_LABEL via getattr() in the backend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
07b68cd73f
commit
46c4c13f3d
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
"""Tests for TYPE_LABEL on OpenMediaVaultDriver."""
|
||||
|
||||
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
|
||||
|
||||
|
||||
def test_type_label_is_storage():
|
||||
assert OpenMediaVaultDriver.TYPE_LABEL == "Storage"
|
||||
|
||||
|
||||
def test_type_label_overrides_linux():
|
||||
from napalm_linux.linux import LinuxDriver
|
||||
assert LinuxDriver.TYPE_LABEL == "Linux"
|
||||
assert OpenMediaVaultDriver.TYPE_LABEL != LinuxDriver.TYPE_LABEL
|
||||
|
||||
|
||||
def test_storage_device_flag_removed():
|
||||
assert not hasattr(OpenMediaVaultDriver, "storage_device"), \
|
||||
"storage_device is superseded by TYPE_LABEL = 'Storage'"
|
||||
Reference in New Issue
Block a user