def setUp(self): super(GetUnpreparedInstallerTest, self).setUp() self.mock_apache_fail_ep = mock.Mock(description_with_name="afail") self.mock_apache_fail_ep.name = "afail" self.mock_apache_ep = mock.Mock(description_with_name="apache") self.mock_apache_ep.name = "apache" self.mock_apache_plugin = mock.MagicMock() self.mock_apache_ep.init.return_value = self.mock_apache_plugin self.plugins = PluginsRegistry({ "afail": self.mock_apache_fail_ep, "apache": self.mock_apache_ep, })
def setUp(self): super().setUp() self.mock_apache_fail_ep = mock.Mock(description_with_name="afail") self.mock_apache_fail_ep.check_name = lambda name: name == "afail" self.mock_apache_ep = mock.Mock(description_with_name="apache") self.mock_apache_ep.check_name = lambda name: name == "apache" self.mock_apache_plugin = mock.MagicMock() self.mock_apache_ep.init.return_value = self.mock_apache_plugin self.plugins = PluginsRegistry({ "afail": self.mock_apache_fail_ep, "apache": self.mock_apache_ep, })
def test_no_available_installers(self): self.config.configurator = "apache" self.plugins = PluginsRegistry({}) self.assertRaises(errors.PluginSelectionError, self._call)
def _create_new_registry(cls, plugins): from certbot._internal.plugins.disco import PluginsRegistry return PluginsRegistry(plugins)