From cbfdfed6c49144cbb14975d4a159aab7d86a90af Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Thu, 14 Jan 2021 00:35:22 +0000 Subject: [PATCH] socks5 test covering failed authenticationn path --- test/support/requests/plugins/proxy.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/support/requests/plugins/proxy.rb b/test/support/requests/plugins/proxy.rb index cde7c678..ebf295ed 100644 --- a/test/support/requests/plugins/proxy.rb +++ b/test/support/requests/plugins/proxy.rb @@ -119,14 +119,24 @@ module Requests # verify_body_length(response) # end - def test_plugin_socks5_proxy_error + def test_plugin_socks5_proxy_negotiation_error proxy = URI(socks5_proxy.first) proxy.password = nil session = HTTPX.plugin(:proxy).with_proxy(uri: [proxy]) uri = build_uri("/get") 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 def test_plugin_ssh_proxy