mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Lint fixes.
This commit is contained in:
parent
9179276cb9
commit
05a61c181b
2 changed files with 14 additions and 14 deletions
|
|
@ -114,7 +114,7 @@ class DNS01ResponseTest(unittest.TestCase):
|
|||
self.assertTrue(self.response.simple_verify(
|
||||
self.chall, "local", KEY.public_key()))
|
||||
mock_resolver.assert_called_once_with(
|
||||
self.chall.validation_domain_name("local"))
|
||||
self.chall.validation_domain_name("local"))
|
||||
|
||||
@mock.patch("acme.dns_resolver.txt_records_for_name")
|
||||
def test_simple_verify_good_validation_multiple_txts(self, mock_resolver):
|
||||
|
|
|
|||
|
|
@ -9,28 +9,28 @@ try:
|
|||
except ImportError: # pragma: no cover
|
||||
dns = None
|
||||
|
||||
def create_txt_response(name, txt_records):
|
||||
"""
|
||||
Returns an RRSet containing the 'txt_records' as the result of a DNS
|
||||
query for 'name'.
|
||||
|
||||
This takes advantage of the fact that an Answer object mostly behaves
|
||||
like an RRset.
|
||||
"""
|
||||
return dns.rrset.from_text_list(name, 60, "IN", "TXT", txt_records)
|
||||
|
||||
|
||||
class TxtRecordsForNameTest(unittest.TestCase):
|
||||
|
||||
def create_txt_response(self, name, txt_records):
|
||||
"""
|
||||
Returns an RRSet containing the 'txt_records' as the result of a DNS
|
||||
query for 'name'.
|
||||
|
||||
This takes advantage of the fact that an Answer object mostly behaves
|
||||
like an RRset.
|
||||
"""
|
||||
return dns.rrset.from_text_list(name, 60, "IN", "TXT", txt_records)
|
||||
|
||||
@mock.patch("acme.dns_resolver.dns.resolver.query")
|
||||
def test_txt_records_for_name_test_with_single_response(self, mock_dns):
|
||||
mock_dns.return_value = self.create_txt_response('name', ['response'])
|
||||
def test_txt_records_for_name_with_single_response(self, mock_dns):
|
||||
mock_dns.return_value = create_txt_response('name', ['response'])
|
||||
self.assertEqual(['response'],
|
||||
dns_resolver.txt_records_for_name('name'))
|
||||
|
||||
@mock.patch("acme.dns_resolver.dns.resolver.query")
|
||||
def test_txt_records_for_name_with_multiple_responses(self, mock_dns):
|
||||
mock_dns.return_value = self.create_txt_response(
|
||||
mock_dns.return_value = create_txt_response(
|
||||
'name', ['response1', 'response2'])
|
||||
self.assertEqual(['response1', 'response2'],
|
||||
dns_resolver.txt_records_for_name('name'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue