diff --git a/pynetbox/core/app.py b/pynetbox/core/app.py index cf0022a6..312eb50c 100644 --- a/pynetbox/core/app.py +++ b/pynetbox/core/app.py @@ -161,7 +161,7 @@ def __setstate__(self, d): self.__dict__.update(d) def __getattr__(self, name): - return App(self.api, "plugins/{}".format(name)) + return App(self.api, "plugins/{}".format(name.replace("_", "-"))) def installed_plugins(self): """ Returns raw response with installed plugins diff --git a/tests/test_app.py b/tests/test_app.py index eb90259e..bee3506b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -73,3 +73,8 @@ def test_installed_plugins(self, *_): plugins = api.plugins.installed_plugins() self.assertEqual(len(plugins), 1) self.assertEqual(plugins[0]["name"], "test_plugin") + + def test_plugin_app_name(self, *_): + api = pynetbox.api(host, **def_kwargs) + test_plugin = api.plugins.test_plugin + self.assertEqual(test_plugin.name, "plugins/test-plugin")