Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setup_class(cls):
Connections.deregister_all()
Connections.register("dummy", DummyConnectionPlugin)
Connections.register("dummy2", DummyConnectionPlugin)
Connections.register("dummy_no_overrides", DummyConnectionPlugin)
def test_register_already_registered_new(self):
with pytest.raises(ConnectionPluginAlreadyRegistered):
Connections.register("dummy", AnotherDummyConnectionPlugin)
def setup_method(self, method):
Connections.deregister_all()
Connections.register("dummy", DummyConnectionPlugin)
Connections.register("another_dummy", AnotherDummyConnectionPlugin)
def test_register_already_registered_same(self):
Connections.register("dummy", DummyConnectionPlugin)
assert Connections.available["dummy"] == DummyConnectionPlugin
def register_default_connection_plugins() -> None:
Connections.register("napalm", Napalm)
Connections.register("netconf", Netconf)
Connections.register("netmiko", Netmiko)
Connections.register("paramiko", Paramiko)