MCPcopy
hub / github.com/psf/requests / test_invalid_ssl_certificate_files

Method test_invalid_ssl_certificate_files

tests/test_requests.py:978–991  ·  view source on GitHub ↗
(self, httpbin_secure)

Source from the content-addressed store, hash-verified

976 )
977
978 def test_invalid_ssl_certificate_files(self, httpbin_secure):
979 INVALID_PATH = "/garbage"
980 with pytest.raises(IOError) as e:
981 requests.get(httpbin_secure(), cert=INVALID_PATH)
982 assert (
983 str(e.value)
984 == f"Could not find the TLS certificate file, invalid path: {INVALID_PATH}"
985 )
986
987 with pytest.raises(IOError) as e:
988 requests.get(httpbin_secure(), cert=(".", INVALID_PATH))
989 assert str(e.value) == (
990 f"Could not find the TLS key file, invalid path: {INVALID_PATH}"
991 )
992
993 @pytest.mark.parametrize(
994 "env, expected",

Callers

nothing calls this directly

Calls 2

httpbin_secureFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected