Closed dbarrosop closed 7 years ago
You want me to test this commit with napalm-ros
?
Yes, please. If I recall correctly you were having issues testing your load_replace
code with our testing framework as it was broken.
(napalm-ros)--- workspace/napalm-ros ‹config ?› » py.test test/unit/TestROSDriver.py -x 2 ↵
==================================================== test session starts =====================================================
platform darwin -- Python 2.7.13, pytest-3.0.6, py-1.4.32, pluggy-0.4.0 -- /Users/lkostka/.virtualenvs/napalm-ros/bin/python2.7
cachedir: .cache
rootdir: /Users/lkostka/workspace/napalm-ros, inifile: setup.cfg
plugins: pythonpath-0.7.1, json-0.4.0, cov-2.4.0, pylama-7.3.3
collected 42 items
test/unit/TestROSDriver.py::TestConfigNetworkDriver::test_replacing_and_committing_config <- napalm_base/test/base.py dupa
ERROR
--------------------------- generated json report: /Users/lkostka/workspace/napalm-ros/report.json ---------------------------
---------- coverage: platform darwin, python 2.7.13-final-0 ----------
Name Stmts Miss Cover
--------------------------------------------
napalm_ros/__init__.py 7 2 71%
napalm_ros/ros.py 154 112 27%
napalm_ros/utils.py 29 26 10%
--------------------------------------------
TOTAL 190 140 26%
=========================================================== ERRORS ===========================================================
_______________________ ERROR at setup of TestConfigNetworkDriver.test_replacing_and_committing_config _______________________
cls = <class 'napalm_base.test.base.TestConfigNetworkDriver'>
@classmethod
def setup_class(cls):
"""Added for py.test/nosetests compatibility"""
print('dupa')
> cls.setUpClass()
E AttributeError: type object 'TestConfigNetworkDriver' has no attribute 'setUpClass'
napalm_base/test/base.py:34: AttributeError
Still does not work.
Your test class has to implement that method. For example:
https://github.com/napalm-automation/napalm-eos/blob/develop/test/unit/TestEOSDriver.py#L24
Ok, just noticed the problem, you are calling the file itself and that's calling the improted class. Call it like this:
py.test -vvv TestROSDriver.py::TestConfigROSDriver
Now it works. Thx.
@luqasz would you care testing, please?