Skip to content

Commit

Permalink
SSLError has different messages in different versions of python...
Browse files Browse the repository at this point in the history
  • Loading branch information
stringertheory committed Jan 30, 2024
1 parent ad79f32 commit 9ee0b3e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_unshorten.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def test_expired_certificate_ignore():
def test_expired_certificate_verify():
url = "https://expired.badssl.com/"
result = unshorten_url(url, verify=True)
assert result == {
"url": "https://expired.badssl.com/",
"resolved": "https://expired.badssl.com/",
"status": None,
"exception": "SSLError: HTTPSConnectionPool(host='expired.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1000)')))",
}
assert result["url"] == "https://expired.badssl.com/"
assert result["resolved"] == "https://expired.badssl.com/"
assert result["status"] is None
assert result["exception"].startswith("SSLError:")

0 comments on commit 9ee0b3e

Please sign in to comment.