diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index e2111fc..f6c77d7 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -89,6 +89,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) except KeyError: pass + self.platform = "s350" self.port = optional_args.get("port", 22) self.device = None self.force_no_enable = optional_args.get("force_no_enable", False) @@ -366,7 +367,7 @@ def _get_facts_uptime(self, show_sys): return uptime_str def _get_facts_parse_inventory(self, show_inventory): - """ inventory can list more modules/devices """ + """inventory can list more modules/devices""" # make 1 module 1 line show_inventory = re.sub(r"\nPID", " PID", show_inventory, re.M) # delete empty lines @@ -473,7 +474,7 @@ def get_interfaces(self): entry = { "is_up": is_up, "is_enabled": is_enabled, - "speed": speed, + "speed": float(speed), "mtu": mtu, "last_flapped": -1.0, "description": description, @@ -525,7 +526,7 @@ def get_interfaces_ip(self): return interfaces def _get_ip_int_line_to_fields(self, line, fields_end): - """ dynamic fields lenghts """ + """dynamic fields lenghts""" line_elems = {} index = 0 f_start = 0 @@ -536,7 +537,7 @@ def _get_ip_int_line_to_fields(self, line, fields_end): return line_elems def _get_ip_int_fields_end(self, dashline): - """ fields length are diferent device to device, detect them on horizontal lin """ + """fields length are diferent device to device, detect them on horizontal line""" fields_end = [m.start() for m in re.finditer(" ", dashline.strip())] # fields_position.insert(0,0) @@ -590,7 +591,7 @@ def get_lldp_neighbors(self): return neighbors def _get_lldp_neighbors_line_to_fields(self, line, fields_end): - """ dynamic fields lenghts """ + """dynamic fields lenghts""" line_elems = {} index = 0 f_start = 0 @@ -601,7 +602,7 @@ def _get_lldp_neighbors_line_to_fields(self, line, fields_end): return line_elems def _get_lldp_neighbors_fields_end(self, dashline): - """ fields length are diferent device to device, detect them on horizontal lin """ + """fields length are diferent device to device, detect them on horizontal line""" fields_end = [m.start() for m in re.finditer(" ", dashline)] fields_end.append(len(dashline)) diff --git a/requirements-dev.txt b/requirements-dev.txt index becc136..69b67af 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,12 +1,14 @@ -black==20.8b1 -coveralls==2.1.2 -ddt==1.4.1 -flake8-import-order==0.18.1 -pytest==5.4.3 -pytest-cov==2.10.1 -pytest-json==0.4.0 -pytest-pythonpath==0.7.3 -pylama==7.7.1 -mock==4.0.2 -tox==3.20.1 -demjson +napalm>=3.0.0, <4.0.0 +netmiko>=3.1.0, <4.0.0 +black +coveralls +ddt +flake8-import-order +pytest==6.2.5 +pytest-cov +pytest-json +pytest-pythonpath +pylama +pyflakes==2.4.0 #prevent problems +mock +tox diff --git a/requirements.txt b/requirements.txt index c17be3f..405545b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -napalm>=3.0.0 -netmiko>=3.1.0 +napalm>=3.0.0, <4.0.0 +netmiko>=3.1.0, <4.0.0 netaddr diff --git a/test/unit/conftest.py b/test/unit/conftest.py index 6f9fb30..bd99cb3 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -1,4 +1,5 @@ """Test fixtures.""" + from builtins import super import pytest diff --git a/test/unit/test_getters.py b/test/unit/test_getters.py index 5f87d9e..e470888 100644 --- a/test/unit/test_getters.py +++ b/test/unit/test_getters.py @@ -1,4 +1,5 @@ """Tests for getters.""" + from napalm.base.test.getters import BaseTestGetters import pytest diff --git a/tox.ini b/tox.ini index 55340d6..d6c5f93 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] #envlist = py3{6,7,8},black,pylama,sphinx -envlist = py3{6,7,8},pylama,black +envlist = py3{8,9,10,11,12},pylama,black skip_missing_interpreters = true [testenv]