forked from AkkomaGang/akkoma
request_builder_test: mode :read got removed
This commit is contained in:
parent
5c3a0dd26e
commit
24d66b60a0
1 changed files with 26 additions and 18 deletions
|
@ -34,6 +34,7 @@ test "send custom user agent" do
|
||||||
|
|
||||||
describe "add_param/4" do
|
describe "add_param/4" do
|
||||||
test "add file parameter" do
|
test "add file parameter" do
|
||||||
|
assert match?(
|
||||||
%Request{
|
%Request{
|
||||||
body: %Tesla.Multipart{
|
body: %Tesla.Multipart{
|
||||||
boundary: _,
|
boundary: _,
|
||||||
|
@ -42,7 +43,7 @@ test "add file parameter" do
|
||||||
%Tesla.Multipart.Part{
|
%Tesla.Multipart.Part{
|
||||||
body: %File.Stream{
|
body: %File.Stream{
|
||||||
line_or_bytes: 2048,
|
line_or_bytes: 2048,
|
||||||
modes: [:raw, :read_ahead, :read, :binary],
|
modes: [:raw, :read_ahead, :binary],
|
||||||
path: "some-path/filename.png",
|
path: "some-path/filename.png",
|
||||||
raw: true
|
raw: true
|
||||||
},
|
},
|
||||||
|
@ -51,7 +52,14 @@ test "add file parameter" do
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
} = RequestBuilder.add_param(%Request{}, :file, "filename.png", "some-path/filename.png")
|
},
|
||||||
|
RequestBuilder.add_param(
|
||||||
|
%Request{},
|
||||||
|
:file,
|
||||||
|
"filename.png",
|
||||||
|
"some-path/filename.png"
|
||||||
|
)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "add key to body" do
|
test "add key to body" do
|
||||||
|
|
Loading…
Reference in a new issue