projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updating tesla ref
[akkoma]
/
test
/
http
/
connection_test.exs
diff --git
a/test/http/connection_test.exs
b/test/http/connection_test.exs
index c1ff0cc21aaff52f74b09aa12d1fc8d3e9bb3f3d..d4db3798c716b80eb46b6fae06780b0c6b862fe2 100644
(file)
--- a/
test/http/connection_test.exs
+++ b/
test/http/connection_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.ConnectionTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.ConnectionTest do
@@
-10,7
+10,7
@@
defmodule Pleroma.HTTP.ConnectionTest do
alias Pleroma.HTTP.Connection
setup_all do
alias Pleroma.HTTP.Connection
setup_all do
- {:ok, _} = Registry.start_link(keys: :unique, name: Pleroma.Gun
.API.
Mock)
+ {:ok, _} = Registry.start_link(keys: :unique, name: Pleroma.GunMock)
:ok
end
:ok
end
@@
-51,31
+51,31
@@
defmodule Pleroma.HTTP.ConnectionTest do
describe "parse_proxy/1 errors" do
test "ip without port" do
capture_log(fn ->
describe "parse_proxy/1 errors" do
test "ip without port" do
capture_log(fn ->
- assert Connection.parse_proxy("127.0.0.1") == {:error, :
error_parsing
_proxy}
+ assert Connection.parse_proxy("127.0.0.1") == {:error, :
invalid
_proxy}
end) =~ "parsing proxy fail \"127.0.0.1\""
end
test "host without port" do
capture_log(fn ->
end) =~ "parsing proxy fail \"127.0.0.1\""
end
test "host without port" do
capture_log(fn ->
- assert Connection.parse_proxy("localhost") == {:error, :
error_parsing
_proxy}
+ assert Connection.parse_proxy("localhost") == {:error, :
invalid
_proxy}
end) =~ "parsing proxy fail \"localhost\""
end
test "host with bad port" do
capture_log(fn ->
end) =~ "parsing proxy fail \"localhost\""
end
test "host with bad port" do
capture_log(fn ->
- assert Connection.parse_proxy("localhost:port") == {:error, :
error_parsing_port_in_proxy
}
+ assert Connection.parse_proxy("localhost:port") == {:error, :
invalid_proxy_port
}
end) =~ "parsing port in proxy fail \"localhost:port\""
end
test "ip with bad port" do
capture_log(fn ->
end) =~ "parsing port in proxy fail \"localhost:port\""
end
test "ip with bad port" do
capture_log(fn ->
- assert Connection.parse_proxy("127.0.0.1:15.9") == {:error, :
error_parsing_port_in_proxy
}
+ assert Connection.parse_proxy("127.0.0.1:15.9") == {:error, :
invalid_proxy_port
}
end) =~ "parsing port in proxy fail \"127.0.0.1:15.9\""
end
test "as tuple without port" do
capture_log(fn ->
end) =~ "parsing port in proxy fail \"127.0.0.1:15.9\""
end
test "as tuple without port" do
capture_log(fn ->
- assert Connection.parse_proxy({:socks5, :localhost}) == {:error, :
error_parsing
_proxy}
+ assert Connection.parse_proxy({:socks5, :localhost}) == {:error, :
invalid
_proxy}
end) =~ "parsing proxy fail {:socks5, :localhost}"
end
end) =~ "parsing proxy fail {:socks5, :localhost}"
end
@@
-124,7
+124,7
@@
defmodule Pleroma.HTTP.ConnectionTest do
uri = URI.parse("https://some-domain.com")
pid = Process.whereis(:federation)
uri = URI.parse("https://some-domain.com")
pid = Process.whereis(:federation)
- :ok = Pleroma.
Pool.Connections.open_con
n(uri, :gun_connections, genserver_pid: pid)
+ :ok = Pleroma.
Gun.Conn.ope
n(uri, :gun_connections, genserver_pid: pid)
opts = Connection.options(uri)
opts = Connection.options(uri)
@@
-134,7
+134,6
@@
defmodule Pleroma.HTTP.ConnectionTest do
assert tls_opts[:depth] == 20
assert tls_opts[:reuse_sessions] == false
assert tls_opts[:depth] == 20
assert tls_opts[:reuse_sessions] == false
- assert opts[:original] == "some-domain.com:443"
assert opts[:close_conn] == false
assert is_pid(opts[:conn])
end
assert opts[:close_conn] == false
assert is_pid(opts[:conn])
end