Package list python-certbot-dns-rfc2136 / cb80383
New upstream version 0.35.1 Harlan Lieberman-Berg 2 years ago
6 changed file(s) with 12 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 0.31.0
2 Version: 0.35.1
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
5656 def _validate_algorithm(self, credentials):
5757 algorithm = credentials.conf('algorithm')
5858 if algorithm:
59 if not self.ALGORITHMS.get(algorithm):
59 if not self.ALGORITHMS.get(algorithm.upper()):
6060 raise errors.PluginError("Unknown algorithm: {0}.".format(algorithm))
6161
6262 def _setup_credentials(self):
219219 except Exception as e:
220220 raise errors.PluginError('Encountered error when making query: {0}'
221221 .format(e))
222
00 """Tests for certbot_dns_rfc2136.dns_rfc2136."""
11
2 import os
32 import unittest
43
54 import dns.flags
87 import mock
98
109 from certbot import errors
10 from certbot.compat import os
1111 from certbot.plugins import dns_test_common
1212 from certbot.plugins.dns_test_common import DOMAIN
1313 from certbot.tests import util as test_util
6363
6464 def test_valid_algorithm_passes(self):
6565 config = VALID_CONFIG.copy()
66 config["rfc2136_algorithm"] = "HMAC-SHA512"
66 config["rfc2136_algorithm"] = "HMAC-sha512"
6767 dns_test_common.write(config, self.config.rfc2136_credentials)
6868
6969 self.auth.perform([self.achall])
170170 result = self.rfc2136_client._query_soa(DOMAIN)
171171
172172 query_mock.assert_called_with(mock.ANY, SERVER, port=PORT)
173 self.assertTrue(result == True)
173 self.assertTrue(result)
174174
175175 @mock.patch("dns.query.udp")
176176 def test_query_soa_not_found(self, query_mock):
180180 result = self.rfc2136_client._query_soa(DOMAIN)
181181
182182 query_mock.assert_called_with(mock.ANY, SERVER, port=PORT)
183 self.assertTrue(result == False)
183 self.assertFalse(result)
184184
185185 @mock.patch("dns.query.udp")
186186 def test_query_soa_wraps_errors(self, query_mock):
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 0.31.0
2 Version: 0.35.1
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
0 acme>=0.21.1
1 certbot>=0.21.1
0 acme>=0.29.0
1 certbot>=0.34.0
22 dnspython
33 mock
44 setuptools
11 from setuptools import find_packages
22
33
4 version = '0.31.0'
4 version = '0.35.1'
55
66 # Remember to update local-oldest-requirements.txt when changing the minimum
77 # acme/certbot version.
88 install_requires = [
9 'acme>=0.21.1',
10 'certbot>=0.21.1',
9 'acme>=0.29.0',
10 'certbot>=0.34.0',
1111 'dnspython',
1212 'mock',
1313 'setuptools',