diff options
Diffstat (limited to 'certbot-dns-luadns/certbot_dns_luadns')
-rw-r--r-- | certbot-dns-luadns/certbot_dns_luadns/_internal/__init__.py | 1 | ||||
-rw-r--r-- | certbot-dns-luadns/certbot_dns_luadns/_internal/dns_luadns.py (renamed from certbot-dns-luadns/certbot_dns_luadns/dns_luadns.py) | 2 | ||||
-rw-r--r-- | certbot-dns-luadns/certbot_dns_luadns/dns_luadns_test.py | 52 |
3 files changed, 2 insertions, 53 deletions
diff --git a/certbot-dns-luadns/certbot_dns_luadns/_internal/__init__.py b/certbot-dns-luadns/certbot_dns_luadns/_internal/__init__.py new file mode 100644 index 000000000..8ab0a00e2 --- /dev/null +++ b/certbot-dns-luadns/certbot_dns_luadns/_internal/__init__.py @@ -0,0 +1 @@ +"""Internal implementation of `~certbot_dns_luadns.dns_luadns` plugin.""" diff --git a/certbot-dns-luadns/certbot_dns_luadns/dns_luadns.py b/certbot-dns-luadns/certbot_dns_luadns/_internal/dns_luadns.py index 7cdd4c8e1..7c18c7131 100644 --- a/certbot-dns-luadns/certbot_dns_luadns/dns_luadns.py +++ b/certbot-dns-luadns/certbot_dns_luadns/_internal/dns_luadns.py @@ -1,8 +1,8 @@ """DNS Authenticator for LuaDNS DNS.""" import logging -import zope.interface from lexicon.providers import luadns +import zope.interface from certbot import errors from certbot import interfaces diff --git a/certbot-dns-luadns/certbot_dns_luadns/dns_luadns_test.py b/certbot-dns-luadns/certbot_dns_luadns/dns_luadns_test.py deleted file mode 100644 index bf77e03e4..000000000 --- a/certbot-dns-luadns/certbot_dns_luadns/dns_luadns_test.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Tests for certbot_dns_luadns.dns_luadns.""" - -import os -import unittest - -import mock -from requests.exceptions import HTTPError - -from certbot.plugins import dns_test_common -from certbot.plugins import dns_test_common_lexicon -from certbot.tests import util as test_util - -EMAIL = 'fake@example.com' -TOKEN = 'foo' - - -class AuthenticatorTest(test_util.TempDirTestCase, - dns_test_common_lexicon.BaseLexiconAuthenticatorTest): - - def setUp(self): - super(AuthenticatorTest, self).setUp() - - from certbot_dns_luadns.dns_luadns import Authenticator - - path = os.path.join(self.tempdir, 'file.ini') - dns_test_common.write({"luadns_email": EMAIL, "luadns_token": TOKEN}, path) - - self.config = mock.MagicMock(luadns_credentials=path, - luadns_propagation_seconds=0) # don't wait during tests - - self.auth = Authenticator(self.config, "luadns") - - self.mock_client = mock.MagicMock() - # _get_luadns_client | pylint: disable=protected-access - self.auth._get_luadns_client = mock.MagicMock(return_value=self.mock_client) - - -class LuaDNSLexiconClientTest(unittest.TestCase, dns_test_common_lexicon.BaseLexiconClientTest): - - LOGIN_ERROR = HTTPError("401 Client Error: Unauthorized for url: ...") - - def setUp(self): - from certbot_dns_luadns.dns_luadns import _LuaDNSLexiconClient - - self.client = _LuaDNSLexiconClient(EMAIL, TOKEN, 0) - - self.provider_mock = mock.MagicMock() - self.client.provider = self.provider_mock - - -if __name__ == "__main__": - unittest.main() # pragma: no cover |