Skip to content

Commit

Permalink
rely on pycurl error code instead of changeable string
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfect5th committed Nov 29, 2024
1 parent ca1a16d commit ff987c7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions landscape/client/broker/tests/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 199 in landscape/client/broker/tests/test_transport.py

View check run for this annotation

Codecov / codecov/patch

landscape/client/broker/tests/test_transport.py#L199

Added line #L199 was not covered by tests

result.addErrback(got_result)
return result

0 comments on commit ff987c7

Please sign in to comment.