socks5 test covering failed authenticationn path

This commit is contained in:
HoneyryderChuck 2021-01-14 00:35:22 +00:00
parent c5512dbbeb
commit cbfdfed6c4

View File

@ -119,14 +119,24 @@ module Requests
# verify_body_length(response) # verify_body_length(response)
# end # end
def test_plugin_socks5_proxy_error def test_plugin_socks5_proxy_negotiation_error
proxy = URI(socks5_proxy.first) proxy = URI(socks5_proxy.first)
proxy.password = nil proxy.password = nil
session = HTTPX.plugin(:proxy).with_proxy(uri: [proxy]) session = HTTPX.plugin(:proxy).with_proxy(uri: [proxy])
uri = build_uri("/get") uri = build_uri("/get")
response = session.get(uri) response = session.get(uri)
verify_error_response(response, HTTPX::Socks5Error) verify_error_response(response, /negotiation error/)
end
def test_plugin_socks5_proxy_authentication_error
proxy = URI(socks5_proxy.first)
proxy.password = "1"
session = HTTPX.plugin(:proxy).with_proxy(uri: [proxy])
uri = build_uri("/get")
response = session.get(uri)
verify_error_response(response, /authentication error/)
end end
def test_plugin_ssh_proxy def test_plugin_ssh_proxy