mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
In order to expose other auth schemes in proxy, the basic, digest and ntlm modules were extracted from the plugins, these being left with the request management. So now, an extra parameter, `:scheme`, can be passed (it'll be "basic" for http and "socks5" for socks5 by default, can also be "digest" or "ntlm", haven't tested those yet).
26 lines
687 B
Ruby
26 lines
687 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "test_helper"
|
|
require "httpx/plugins/proxy"
|
|
|
|
class ProxyTest < Minitest::Test
|
|
include HTTPX
|
|
|
|
def test_parameters_equality
|
|
params = parameters(username: "user", password: "pass")
|
|
assert params == parameters(username: "user", password: "pass")
|
|
assert params != parameters(username: "user2", password: "pass")
|
|
assert params != parameters
|
|
assert params == URI.parse("http://user:pass@proxy")
|
|
assert params == "http://user:pass@proxy"
|
|
assert params != "bamalam"
|
|
assert params != 1
|
|
end
|
|
|
|
private
|
|
|
|
def parameters(uri: "http://proxy", **args)
|
|
Plugins::Proxy::Parameters.new(uri: uri, **args)
|
|
end
|
|
end
|