summaryrefslogtreecommitdiff
path: root/test/http
diff options
context:
space:
mode:
Diffstat (limited to 'test/http')
-rw-r--r--test/http/adapter_helper/gun_test.exs4
-rw-r--r--test/http/connection_test.exs28
2 files changed, 2 insertions, 30 deletions
diff --git a/test/http/adapter_helper/gun_test.exs b/test/http/adapter_helper/gun_test.exs
index c65b89786..66622b605 100644
--- a/test/http/adapter_helper/gun_test.exs
+++ b/test/http/adapter_helper/gun_test.exs
@@ -24,8 +24,8 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
defp gun_mock do
Pleroma.GunMock
|> stub(:open, fn _, _, _ -> Task.start_link(fn -> Process.sleep(1000) end) end)
- |> expect(:await_up, fn _, _ -> {:ok, :http} end)
- |> expect(:set_owner, fn _, _ -> :ok end)
+ |> stub(:await_up, fn _, _ -> {:ok, :http} end)
+ |> stub(:set_owner, fn _, _ -> :ok end)
end
describe "options/1" do
diff --git a/test/http/connection_test.exs b/test/http/connection_test.exs
index a5ddfd435..25a2bac1c 100644
--- a/test/http/connection_test.exs
+++ b/test/http/connection_test.exs
@@ -7,13 +7,10 @@ defmodule Pleroma.HTTP.ConnectionTest do
use Pleroma.Tests.Helpers
import ExUnit.CaptureLog
- import Mox
alias Pleroma.Config
alias Pleroma.HTTP.Connection
- setup :verify_on_exit!
-
describe "parse_host/1" do
test "as atom to charlist" do
assert Connection.parse_host(:localhost) == 'localhost'
@@ -115,30 +112,5 @@ defmodule Pleroma.HTTP.ConnectionTest do
assert opts[:proxy] == {'example.com', 4321}
end
-
- test "default ssl adapter opts with connection" do
- adapter = Application.get_env(:tesla, :adapter)
- Application.put_env(:tesla, :adapter, Tesla.Adapter.Gun)
- on_exit(fn -> Application.put_env(:tesla, :adapter, adapter) end)
-
- uri = URI.parse("https://some-domain.com")
-
- Pleroma.GunMock
- |> expect(:open, fn 'some-domain.com', 443, _ ->
- Task.start_link(fn -> Process.sleep(1000) end)
- end)
- |> expect(:await_up, fn _, _ -> {:ok, :http2} end)
- |> expect(:set_owner, fn _, _ -> :ok end)
-
- :ok = Pleroma.Gun.Conn.open(uri, :gun_connections)
-
- opts = Connection.options(uri)
-
- assert opts[:certificates_verification]
- refute opts[:tls_opts] == []
-
- assert opts[:close_conn] == false
- assert is_pid(opts[:conn])
- end
end
end