mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-11-29 00:01:06 -05:00
linting previous test
This commit is contained in:
parent
a6cfaf4ec3
commit
0a35b125f4
@ -9,8 +9,8 @@ class Bug_0_22_2_Test < Minitest::Test
|
|||||||
|
|
||||||
Plugin = Module.new do
|
Plugin = Module.new do
|
||||||
@connections = []
|
@connections = []
|
||||||
def self.connections
|
class << self
|
||||||
@connections
|
attr_reader :connections
|
||||||
end
|
end
|
||||||
|
|
||||||
self::ConnectionMethods = Module.new do
|
self::ConnectionMethods = Module.new do
|
||||||
@ -22,11 +22,12 @@ class Bug_0_22_2_Test < Minitest::Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_happy_eyeballs_v2_use_correct_family
|
def test_happy_eyeballs_v2_use_correct_family
|
||||||
connections = []
|
ipv4_host = "badipv6.test.ipv6friday.org"
|
||||||
|
ipv6_host = "badipv4.test.ipv6friday.org"
|
||||||
|
|
||||||
HTTPX.plugin(Plugin).wrap do |http|
|
HTTPX.plugin(Plugin).wrap do |http|
|
||||||
response_ipv4 = http.get("http://#{ipv4_host}")
|
_response_ipv4 = http.get("http://#{ipv4_host}")
|
||||||
response_ipv6 = http.get("http://#{ipv6_host}")
|
_response_ipv6 = http.get("http://#{ipv6_host}")
|
||||||
end
|
end
|
||||||
assert Plugin.connections.size == 2
|
assert Plugin.connections.size == 2
|
||||||
connection_ipv4 = Plugin.connections.find { |conn| conn.origin.to_s == "http://#{ipv4_host}" }
|
connection_ipv4 = Plugin.connections.find { |conn| conn.origin.to_s == "http://#{ipv4_host}" }
|
||||||
@ -35,14 +36,4 @@ class Bug_0_22_2_Test < Minitest::Test
|
|||||||
assert connection_ipv4.family == Socket::AF_INET
|
assert connection_ipv4.family == Socket::AF_INET
|
||||||
assert connection_ipv6.family == Socket::AF_INET6
|
assert connection_ipv6.family == Socket::AF_INET6
|
||||||
end
|
end
|
||||||
|
end
|
||||||
private
|
|
||||||
|
|
||||||
def ipv4_host
|
|
||||||
"badipv6.test.ipv6friday.org"
|
|
||||||
end
|
|
||||||
|
|
||||||
def ipv6_host
|
|
||||||
"badipv4.test.ipv6friday.org"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user