Skip to content

Commit

Permalink
Update test_idna_encoding_query_a with new errno to align to new c-ar…
Browse files Browse the repository at this point in the history
…es version (#194)
  • Loading branch information
kitterma authored Jan 2, 2024
1 parent 54310ff commit b005f58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ def cb(result, errorno):
# try encoding it as utf-8
self.channel.query(host.encode(), pycares.QUERY_TYPE_A, cb)
self.wait()
self.assertEqual(self.errorno, pycares.errno.ARES_ENOTFOUND)
# ARES_EBADNAME correct for c-ares 1.24 and ARES_ENOTFOUND for 1.18
if self.errorno == pycares.errno.ARES_ENOTFOUND:
self.errorno = pycares.errno.ARES_EBADNAME
self.assertEqual(self.errorno, pycares.errno.ARES_EBADNAME)
self.assertEqual(self.result, None)
# use it as is (it's IDNA encoded internally)
self.channel.query(host, pycares.QUERY_TYPE_A, cb)
Expand Down

0 comments on commit b005f58

Please sign in to comment.