mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:41:53 +02:00
Lint fixes.
This commit is contained in:
@@ -9,10 +9,7 @@ try:
|
||||
except ImportError: # pragma: no cover
|
||||
dns = None
|
||||
|
||||
|
||||
class TxtRecordsForNameTest(unittest.TestCase):
|
||||
|
||||
def create_txt_response(self, name, txt_records):
|
||||
def create_txt_response(name, txt_records):
|
||||
"""
|
||||
Returns an RRSet containing the 'txt_records' as the result of a DNS
|
||||
query for 'name'.
|
||||
@@ -22,15 +19,18 @@ class TxtRecordsForNameTest(unittest.TestCase):
|
||||
"""
|
||||
return dns.rrset.from_text_list(name, 60, "IN", "TXT", txt_records)
|
||||
|
||||
|
||||
class TxtRecordsForNameTest(unittest.TestCase):
|
||||
|
||||
@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'))
|
||||
|
||||
Reference in New Issue
Block a user