ixs / napalm-procurve

HP ProCurve Driver for NAPALM automation frontend
Apache License 2.0
21 stars 15 forks source link

Two tests failed: TestGetter.test_method_signatures and TestGetter.test_get_config_filtered[normal] #19

Open mcepl opened 3 years ago

mcepl commented 3 years ago

When packaging napalm-procurve 0.7.0 for openSUSE/Factory two tests fail:

[   45s] =================================== FAILURES ===================================
[   45s] ______________________ TestGetter.test_method_signatures _______________________
[   45s]
[   45s] self = <test_getters.TestGetter object at 0x7fcfc5123cf8>
[   45s]
[   45s]     def test_method_signatures(self):
[   45s]         """Test that all methods have the same signature."""
[   45s]         errors = {}
[   45s]         cls = self.driver
[   45s]         # Create fictional driver instance (py3 needs bound methods)
[   45s]         tmp_obj = cls(hostname="test", username="admin", password="pwd")
[   45s]         attrs = [m for m, v in inspect.getmembers(tmp_obj)]
[   45s]         for attr in attrs:
[   45s]             func = getattr(tmp_obj, attr)
[   45s]             if attr.startswith("_") or not inspect.ismethod(func):
[   45s]                 continue
[   45s]             try:
[   45s]                 orig = getattr(NetworkDriver, attr)
[   45s]                 orig_spec = inspect.getfullargspec(orig)
[   45s]             except AttributeError:
[   45s]                 orig_spec = "Method does not exist in napalm.base"
[   45s]             func_spec = inspect.getfullargspec(func)
[   45s]             if orig_spec != func_spec:
[   45s]                 errors[attr] = (orig_spec, func_spec)
[   45s]
[   45s]         EXTRA_METHODS = ["__init__"]
[   45s]         for method in EXTRA_METHODS:
[   45s]             orig_spec = inspect.getfullargspec(getattr(NetworkDriver, method))
[   45s]             func_spec = inspect.getfullargspec(getattr(cls, method))
[   45s]             if orig_spec != func_spec:
[   45s]                 errors[attr] = (orig_spec, func_spec)
[   45s]
[   45s] >       assert not errors, "Some methods vary. \n{}".format(errors.keys())
[   45s] E       AssertionError: Some methods vary.
[   45s] E       dict_keys(['ping'])
[   45s]
[   45s] /usr/lib/python3.6/site-packages/napalm/base/test/getters.py:138: AssertionError
[   45s] _________________ TestGetter.test_get_config_filtered[normal] __________________
[   45s]
[   45s] self = <test_getters.TestGetter object at 0x7fcfc50a5e48>, test_case = 'normal'
[   45s]
[   45s]     @wrap_test_cases
[   45s]     def test_get_config_filtered(self, test_case):
[   45s]         """Test get_config method."""
[   45s] >       if self.device.platform == "iosxr_netconf":
[   45s] E       AttributeError: 'PatchedProcurveDriver' object has no attribute 'platform'
[   45s]
[   45s] /usr/lib/python3.6/site-packages/napalm/base/test/getters.py:515: AttributeError
[   45s] =============================== warnings summary ===============================
[   45s] ../../../../../usr/lib/python3.6/site-packages/_pytest/config/__init__.py:1233
[   45s]   /usr/lib/python3.6/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: json_report
[   45s]
[   45s]     self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
[   45s]
[   45s] ../../../../../usr/lib/python3.6/site-packages/_pytest/config/__init__.py:1233
[   45s]   /usr/lib/python3.6/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: jsonapi
[   45s]
[   45s]     self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
[   45s]
[   45s] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[   45s]
[   45s] ---------- coverage: platform linux, python 3.6.14-final-0 -----------
[   45s] Name                                Stmts   Miss  Cover   Missing
[   45s] -----------------------------------------------------------------
[   45s] napalm_procurve/__init__.py             3      3     0%   15-18
[   45s] napalm_procurve/procurve.py           444    444     0%   14-858
[   45s] napalm_procurve/utils/__init__.py       0      0   100%
[   45s] -----------------------------------------------------------------
[   45s] TOTAL                                 447    447     0%
[   45s]
[   45s] =========================== short test summary info ============================
[   45s] FAILED test/unit/test_getters.py::TestGetter::test_method_signatures - Assert...
[   45s] FAILED test/unit/test_getters.py::TestGetter::test_get_config_filtered[normal]
[   45s] ============= 2 failed, 28 passed, 19 skipped, 2 warnings in 1.33s =============
[   45s] Coverage.py warning: No data was collected. (no-data-collected)

Complete build log with all versions of packages used and all steps taken.