refactor: the SNMP health profile shapes in snmp_health_profile.py
models.py is over the file size limit and may not grow; the unknown key pushed it past its recorded length. SnmpHealthProfile, SnmpValueSpec, SnmpMemorySpec and SnmpInterfacesSpec move to napalm_device_types/snmp_health_profile.py. The package exports them as before and models re-exports them, so existing imports keep working. The baseline records the smaller models.py.
This commit is contained in:
1 parent
83ea13f88e
commit
f4354f498e
7 files changed
+87
-59
No files matched your search
@@ -32,7 +32,7 @@
|
||||
},
|
||||
"mypy_relaxed": [],
|
||||
"python_file_lines": {
|
||||
"napalm_device_types/models.py": 1504
|
||||
"napalm_device_types/models.py": 1463
|
||||
},
|
||||
"untyped_public": []
|
||||
}
|
||||
@@ -52,6 +52,14 @@ def test_a_value_the_agent_gets_wrong_is_declared_unknown():
|
||||
assert Driver.SNMP_HEALTH_PROFILE["cpu"].get("unknown") is True
|
||||
|
||||
|
||||
def test_the_shapes_live_in_their_own_module_and_models_still_exports_them():
|
||||
from napalm_device_types import models, snmp_health_profile
|
||||
|
||||
for name in ("SnmpHealthProfile", "SnmpValueSpec", "SnmpMemorySpec", "SnmpInterfacesSpec"):
|
||||
assert getattr(models, name) is getattr(snmp_health_profile, name), name
|
||||
assert getattr(snmp_health_profile, name).__module__ == snmp_health_profile.__name__
|
||||
|
||||
|
||||
def test_the_collector_in_the_base_package_warns_that_it_is_deprecated():
|
||||
async def get(oid):
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user