Skip to content

Instantly share code, notes, and snippets.

@ktbyers
Created April 19, 2017 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktbyers/c5f351321c7b761a3557489713116e28 to your computer and use it in GitHub Desktop.
Save ktbyers/c5f351321c7b761a3557489713116e28 to your computer and use it in GitHub Desktop.
NAPALM transition signatures
class BaseTestGetters(object):
"""Base class for testing drivers."""
def test_method_signatures(self):
"""Test that all methods have the same signature."""
# Method signatures that are migrating from old to new state (temporary state)
TRANSITION_SIGNATURES = [
'commit_config',
'commit_confirm',
]
errors = {}
cls = self.driver
# Create fictional driver instance (py3 needs bound methods)
tmp_obj = cls(hostname='test', username='admin', password='pwd')
attrs = [m for m, v in inspect.getmembers(tmp_obj)]
for attr in attrs:
if attr in TRANSITION_SIGNATURES:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment