From b005f58d5e39b166427cb4546dbcc26c61ec40d3 Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Tue, 2 Jan 2024 14:45:28 -0500 Subject: [PATCH] Update test_idna_encoding_query_a with new errno to align to new c-ares version (#194) --- tests/test_all.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_all.py b/tests/test_all.py index 41aefc4..dd00323 100755 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -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)