chg: [internal] Resolve deprecation warning in dbl_spamhaus

pull/620/head
Jakub Onderka 2023-07-01 14:46:28 +02:00
parent f6d138dbd5
commit 1bd619914b
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ def handler(q=False):
return misperrors
query = "{}.{}".format(requested_value, dbl)
try:
query_result = resolver.query(query, 'A')[0]
query_result = resolver.resolve(query, 'A')[0]
result = "{} - {}".format(requested_value, dbl_mapping[str(query_result)])
except dns.resolver.NXDOMAIN as e:
result = e.msg

View File

@ -198,7 +198,7 @@ class TestExpansions(unittest.TestCase):
self.assertEqual(self.get_values(response), 'totalmateria.net - spam test domain')
except Exception:
try:
self.assertTrue(self.get_values(response).startswith('None of DNS query names exist:'))
self.assertTrue(self.get_values(response).startswith('The DNS query name does not exist:'))
except Exception:
self.assertEqual(self.get_errors(response), 'Not able to reach dbl.spamhaus.org or something went wrong')