Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F114198
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/test/tesla/adapter/hackney_test.exs b/test/tesla/adapter/hackney_test.exs
index d18ffda..7c7061f 100644
--- a/test/tesla/adapter/hackney_test.exs
+++ b/test/tesla/adapter/hackney_test.exs
@@ -1,65 +1,64 @@
defmodule Tesla.Adapter.HackneyTest do
use ExUnit.Case
use Tesla.AdapterCase, adapter: Tesla.Adapter.Hackney
use Tesla.AdapterCase.Basic
use Tesla.AdapterCase.Multipart
use Tesla.AdapterCase.StreamRequestBody
use Tesla.AdapterCase.SSL,
ssl_options: [
cacertfile: "#{:code.priv_dir(:httparrot)}/ssl/server-ca.crt"
]
alias Tesla.Env
test "get with `with_body: true` option" do
request = %Env{
method: :get,
url: "#{@http}/ip"
}
assert {:ok, %Env{} = response} = call(request, with_body: true)
assert response.status == 200
end
test "get with `with_body: true` option even when async" do
request = %Env{
method: :get,
url: "#{@http}/ip"
}
assert {:ok, %Env{} = response} = call(request, with_body: true, async: true)
assert response.status == 200
assert is_reference(response.body) == true
end
test "request timeout error" do
request = %Env{
method: :get,
url: "#{@http}/delay/10",
body: "test"
}
assert {:error, :timeout} = call(request, recv_timeout: 100)
end
test "stream request body: error" do
body =
Stream.unfold(5, fn
0 -> nil
3 -> {fn -> {:error, :fake_error} end, 2}
n -> {to_string(n), n - 1}
end)
request = %Env{
method: :post,
url: "#{@http}/post",
body: body
}
assert {:error, :fake_error} = call(request)
end
-
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 10:37 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40100
Default Alt Text
(1 KB)
Attached To
Mode
R28 tesla
Attached
Detach File
Event Timeline
Log In to Comment