-
Notifications
You must be signed in to change notification settings - Fork 48
Improve coverage of get_network_driver() #263
Conversation
Looks like a specific package would be better, as napalm-logs isn't Python3 ready. :( |
@bewing please remove napalm-logs from the requirements - this is not a regular driver: see the readme (although there's no proper documentation): https://github.com/napalm-automation/napalm-logs |
@mirceaulinic The point was to have a napalm_ module that does NOT contain a NetworkDriver() method, to improve test coverage in |
@bewing what branch of the code you want to test? |
Ok, you can probably use any module already imported. Like the |
Tried that already - if the module doesn't start with napalm_, it's prepended, so passing "sys" means we hit the non-existent module check for "napalm_sys" instead of the "real module, no driver" check |
We should probably fix that. Maybe we can add a kw argument to avoid prepending?
|
Sorry for the delay -- had some spam folder issues. |
LGTM @ktbyers @mirceaulinic any comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane
* Fix mac address format * Documentation: Fix example mac addresses to be proper form * Correctly check all keys comply (#266) * Improve coverage of get_network_driver() (#263) * Improve coverage of get_network_driver * Revert import of napalm_logs for tests * Driver prepending optional * Test more branches in get_network_driver * Added AttributeError Exception to __del__ function in NetworkDriver (#268) * Added AttributeError Exception to __del__ function in NetworkDriver class * Added AttributeError Exception to __del__ function in NetworkDriver * Dumb driver (#269) * Context manager propagates exceptions properly * Implemented generic mock driver * Add possibility to raise Exceptions on demand * Mock cli commands individually * Map junos' _rpc to cli * Mocking configuration management methods * Added tests for configuration methods * Bump version to 0.24.2 (#270)
…to tox * 'develop' of github.com:napalm-automation/napalm-base: Bump version to 0.24.3 (napalm-automation#275) Validate string before evaluating (napalm-automation#274) Bump version to 0.24.2 (napalm-automation#270) Dumb driver (napalm-automation#269) Added AttributeError Exception to __del__ function in NetworkDriver (napalm-automation#268) Improve coverage of get_network_driver() (napalm-automation#263)
Not sure if using napalm-logs to test a real module not having NetworkDriver is correct, or if we should create a specific dummy module to test. Also test a non-string type to hit 86, napalm_eos to hit cover 94->96 jump.