diff options
author | feld <feld@feld.me> | 2020-04-01 17:05:09 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-04-01 17:05:09 +0000 |
commit | ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc (patch) | |
tree | 2058bf1189b7a7ba12b1a160c27a9e92f3fa28bb /test/http/adapter_helper_test.exs | |
parent | bfec45bf740f9fcfcea92bbded6bd2c146dc64c1 (diff) | |
parent | 1fcdcb12a717fa3dbd54a5c3778bd216df6449ad (diff) | |
download | pleroma-ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc.tar.gz pleroma-ef7d2b0f11a9bf74e982b73ae4cec632f93fbebc.zip |
Merge branch 'gun' into 'develop'
Gun adapter
Closes #945
See merge request pleroma/pleroma!1861
Diffstat (limited to 'test/http/adapter_helper_test.exs')
-rw-r--r-- | test/http/adapter_helper_test.exs | 28 |
1 files changed, 28 insertions, 0 deletions
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 |