summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-12-29 18:33:53 +0000
committerMark Felder <feld@feld.me>2022-12-20 09:55:00 -0500
commit608c964220c362c5f26df88a3a958cced7a2dc58 (patch)
treef79cac34645e75ff707b7773c1946206c00a6fae /test
parent0840ce56710b51389adaaf24ad8643b362b7f4cc (diff)
Finch everywhere
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/config/deprecation_warnings_test.exs44
-rw-r--r--test/pleroma/reverse_proxy_test.exs38
-rw-r--r--test/test_helper.exs3
3 files changed, 0 insertions, 85 deletions
diff --git a/test/pleroma/config/deprecation_warnings_test.exs b/test/pleroma/config/deprecation_warnings_test.exs
index f3453ddb0..55d03b70f 100644
--- a/test/pleroma/config/deprecation_warnings_test.exs
+++ b/test/pleroma/config/deprecation_warnings_test.exs
@@ -336,50 +336,6 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
"Your config is using the old setting for controlling the URL of media uploaded to your S3 bucket."
end
- describe "check_gun_pool_options/0" do
- test "await_up_timeout" do
- config = Config.get(:connections_pool)
- clear_config(:connections_pool, Keyword.put(config, :await_up_timeout, 5_000))
-
- assert capture_log(fn ->
- DeprecationWarnings.check_gun_pool_options()
- end) =~
- "Your config is using old setting `config :pleroma, :connections_pool, await_up_timeout`."
- end
-
- test "pool timeout" do
- old_config = [
- federation: [
- size: 50,
- max_waiting: 10,
- timeout: 10_000
- ],
- media: [
- size: 50,
- max_waiting: 10,
- timeout: 10_000
- ],
- upload: [
- size: 25,
- max_waiting: 5,
- timeout: 15_000
- ],
- default: [
- size: 10,
- max_waiting: 2,
- timeout: 5_000
- ]
- ]
-
- clear_config(:pools, old_config)
-
- assert capture_log(fn ->
- DeprecationWarnings.check_gun_pool_options()
- end) =~
- "Your config is using old setting name `timeout` instead of `recv_timeout` in pool settings"
- end
- end
-
test "check_old_chat_shoutbox/0" do
clear_config([:instance, :chat_limit], 1_000)
clear_config([:chat, :enabled], true)
diff --git a/test/pleroma/reverse_proxy_test.exs b/test/pleroma/reverse_proxy_test.exs
index 0bd4db8d1..54e860b6c 100644
--- a/test/pleroma/reverse_proxy_test.exs
+++ b/test/pleroma/reverse_proxy_test.exs
@@ -8,44 +8,10 @@ defmodule Pleroma.ReverseProxyTest do
import Mox
alias Pleroma.ReverseProxy
- alias Pleroma.ReverseProxy.ClientMock
alias Plug.Conn
- setup_all do
- {:ok, _} = Registry.start_link(keys: :unique, name: ClientMock)
- :ok
- end
-
- setup :verify_on_exit!
-
- defp request_mock(invokes) do
- ClientMock
- |> expect(:request, fn :get, url, headers, _body, _opts ->
- Registry.register(ClientMock, url, 0)
- body = headers |> Enum.into(%{}) |> Jason.encode!()
-
- {:ok, 200,
- [
- {"content-type", "application/json"},
- {"content-length", byte_size(body) |> to_string()}
- ], %{url: url, body: body}}
- end)
- |> expect(:stream_body, invokes, fn %{url: url, body: body} = client ->
- case Registry.lookup(ClientMock, url) do
- [{_, 0}] ->
- Registry.update_value(ClientMock, url, &(&1 + 1))
- {:ok, body, client}
-
- [{_, 1}] ->
- Registry.unregister(ClientMock, url)
- :done
- end
- end)
- end
-
describe "reverse proxy" do
test "do not track successful request", %{conn: conn} do
- request_mock(2)
url = "/success"
conn = ReverseProxy.call(conn, url)
@@ -56,8 +22,6 @@ defmodule Pleroma.ReverseProxyTest do
end
test "use Pleroma's user agent in the request; don't pass the client's", %{conn: conn} do
- request_mock(2)
-
conn =
conn
|> Plug.Conn.put_req_header("user-agent", "fake/1.0")
@@ -110,8 +74,6 @@ defmodule Pleroma.ReverseProxyTest do
describe "max_body" do
test "length returns error if content-length more than option", %{conn: conn} do
- request_mock(0)
-
assert capture_log(fn ->
ReverseProxy.call(conn, "/huge-file", max_body_length: 4)
end) =~
diff --git a/test/test_helper.exs b/test/test_helper.exs
index 60a61484f..d2016ff53 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -7,9 +7,6 @@ ExUnit.start(exclude: [:federated, :erratic] ++ os_exclude)
Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, :manual)
-Mox.defmock(Pleroma.ReverseProxy.ClientMock, for: Pleroma.ReverseProxy.Client)
-Mox.defmock(Pleroma.GunMock, for: Pleroma.Gun)
-
{:ok, _} = Application.ensure_all_started(:ex_machina)
ExUnit.after_suite(fn _results ->