From ff987c75aeb9d3a4708fa659cc3b89a2bd3e1f8d Mon Sep 17 00:00:00 2001 From: Mitch Burton Date: Fri, 29 Nov 2024 15:42:10 -0800 Subject: [PATCH] rely on pycurl error code instead of changeable string --- landscape/client/broker/tests/test_transport.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/landscape/client/broker/tests/test_transport.py b/landscape/client/broker/tests/test_transport.py index fece3b0f..3baf7435 100644 --- a/landscape/client/broker/tests/test_transport.py +++ b/landscape/client/broker/tests/test_transport.py @@ -193,16 +193,10 @@ def test_ssl_verification_negative(self): message_api=b"X.Y", ) - def got_result(ignored): + def got_result(failure): self.assertIs(r.request, None) self.assertIs(r.content, None) - logfile_value = self.logfile.getvalue() - # pycurl error messages vary by version. - # First is for <= noble, second for > noble. - self.assertTrue( - "server certificate verification failed" in logfile_value - or "SSL certificate problem" in logfile_value, - ) + self.assertEqual(failure.value.error_code, 60) result.addErrback(got_result) return result