aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-03-03 18:53:44 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-03-03 18:53:44 +0300
commitf98ee730f01de528797e38f27964b69a465662c4 (patch)
treef15957c800066361ee9031f120edbd205f069cb5 /test
parent8854770fc4e9079131a0897d5fb6c0ccccf98bc6 (diff)
downloadpleroma-f98ee730f01de528797e38f27964b69a465662c4.tar.gz
adapter renaming to adapter_helper
Diffstat (limited to 'test')
-rw-r--r--test/http/adapter_helper/gun_test.exs (renamed from test/http/adapter/gun_test.exs)4
-rw-r--r--test/http/adapter_helper/hackney_test.exs (renamed from test/http/adapter/hackney_test.exs)4
-rw-r--r--test/http/adapter_helper_test.exs28
-rw-r--r--test/http/adapter_test.exs27
4 files changed, 32 insertions, 31 deletions
diff --git a/test/http/adapter/gun_test.exs b/test/http/adapter_helper/gun_test.exs
index a05471ac6..bc7e3f0e0 100644
--- a/test/http/adapter/gun_test.exs
+++ b/test/http/adapter_helper/gun_test.exs
@@ -2,13 +2,13 @@
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
-defmodule Pleroma.HTTP.Adapter.GunTest do
+defmodule Pleroma.HTTP.AdapterHelper.GunTest do
use ExUnit.Case, async: true
use Pleroma.Tests.Helpers
import ExUnit.CaptureLog
alias Pleroma.Config
alias Pleroma.Gun.Conn
- alias Pleroma.HTTP.Adapter.Gun
+ alias Pleroma.HTTP.AdapterHelper.Gun
alias Pleroma.Pool.Connections
setup_all do
diff --git a/test/http/adapter/hackney_test.exs b/test/http/adapter_helper/hackney_test.exs
index 35cb58125..82f5a7883 100644
--- a/test/http/adapter/hackney_test.exs
+++ b/test/http/adapter_helper/hackney_test.exs
@@ -2,12 +2,12 @@
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
-defmodule Pleroma.HTTP.Adapter.HackneyTest do
+defmodule Pleroma.HTTP.AdapterHelper.HackneyTest do
use ExUnit.Case
use Pleroma.Tests.Helpers
alias Pleroma.Config
- alias Pleroma.HTTP.Adapter.Hackney
+ alias Pleroma.HTTP.AdapterHelper.Hackney
setup_all do
uri = URI.parse("http://domain.com")
diff --git a/test/http/adapter_helper_test.exs b/test/http/adapter_helper_test.exs
new file mode 100644
index 000000000..24d501ad5
--- /dev/null
+++ b/test/http/adapter_helper_test.exs
@@ -0,0 +1,28 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.HTTP.AdapterHelperTest do
+ use ExUnit.Case, async: true
+
+ alias Pleroma.HTTP.AdapterHelper
+
+ describe "format_proxy/1" do
+ test "with nil" do
+ assert AdapterHelper.format_proxy(nil) == nil
+ end
+
+ test "with string" do
+ assert AdapterHelper.format_proxy("127.0.0.1:8123") == {{127, 0, 0, 1}, 8123}
+ end
+
+ test "localhost with port" do
+ assert AdapterHelper.format_proxy("localhost:8123") == {'localhost', 8123}
+ end
+
+ test "tuple" do
+ assert AdapterHelper.format_proxy({:socks4, :localhost, 9050}) ==
+ {:socks4, 'localhost', 9050}
+ end
+ end
+end
diff --git a/test/http/adapter_test.exs b/test/http/adapter_test.exs
deleted file mode 100644
index 4c805837c..000000000
--- a/test/http/adapter_test.exs
+++ /dev/null
@@ -1,27 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.HTTP.AdapterTest do
- use ExUnit.Case, async: true
-
- alias Pleroma.HTTP.Adapter
-
- describe "format_proxy/1" do
- test "with nil" do
- assert Adapter.format_proxy(nil) == nil
- end
-
- test "with string" do
- assert Adapter.format_proxy("127.0.0.1:8123") == {{127, 0, 0, 1}, 8123}
- end
-
- test "localhost with port" do
- assert Adapter.format_proxy("localhost:8123") == {'localhost', 8123}
- end
-
- test "tuple" do
- assert Adapter.format_proxy({:socks4, :localhost, 9050}) == {:socks4, 'localhost', 9050}
- end
- end
-end