def setUp(self, mock_dns_provider_service): self.ACMEIssuerPlugin = plugin.ACMEIssuerPlugin() self.acme = plugin.AcmeHandler() mock_dns_provider = Mock() mock_dns_provider.name = "powerdns" mock_dns_provider.credentials = "{}" mock_dns_provider.provider_type = "powerdns" self.acme.dns_providers_for_domain = { "www.test.com": [mock_dns_provider], "test.fakedomain.net": [mock_dns_provider], }
def setUp(self, mock_dns_provider_service): self.ACMEIssuerPlugin = plugin.ACMEIssuerPlugin() self.acme = plugin.AcmeHandler() mock_dns_provider = Mock() mock_dns_provider.name = "powerdns" mock_dns_provider.credentials = "{}" mock_dns_provider.provider_type = "powerdns" self.acme.dns_providers_for_domain = { "www.test.com": [mock_dns_provider], "test.fakedomain.net": [mock_dns_provider], } # Creates a new Flask application for a test duration. In python 3.8, manual push of application context is # needed to run tests in dev environment without getting error 'Working outside of application context'. _app = Flask('lemur_test_acme') self.ctx = _app.app_context() assert self.ctx self.ctx.push()