Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33103490
hackney_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
928 B
Referenced Files
None
Subscribers
None
hackney_test.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.HTTP.AdapterHelper.HackneyTest
do
use
ExUnit.Case
use
Pleroma.Tests.Helpers
alias
Pleroma.HTTP.AdapterHelper.Hackney
setup_all
do
uri
=
URI
.
parse
(
"http://domain.com"
)
{
:ok
,
uri
:
uri
}
end
describe
"options/2"
do
setup
do
:
clear_config
([
:http
,
:adapter
],
a
:
1
,
b
:
2
)
test
"add proxy and opts from config"
,
%{
uri
:
uri
}
do
opts
=
Hackney
.
options
([
proxy
:
"localhost:8123"
],
uri
)
assert
opts
[
:a
]
==
1
assert
opts
[
:b
]
==
2
assert
opts
[
:proxy
]
==
"localhost:8123"
end
test
"respect connection opts and no proxy"
,
%{
uri
:
uri
}
do
opts
=
Hackney
.
options
([
a
:
2
,
b
:
1
],
uri
)
assert
opts
[
:a
]
==
2
assert
opts
[
:b
]
==
1
refute
Keyword
.
has_key?
(
opts
,
:proxy
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 20, 1:53 PM (17 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
973782
Default Alt Text
hackney_test.exs (928 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment