request_builder_test: mode :read got removed
This commit is contained in:
parent
5c3a0dd26e
commit
24d66b60a0
@ -34,24 +34,32 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
|
|||||||
|
|
||||||
describe "add_param/4" do
|
describe "add_param/4" do
|
||||||
test "add file parameter" do
|
test "add file parameter" do
|
||||||
%Request{
|
assert match?(
|
||||||
body: %Tesla.Multipart{
|
%Request{
|
||||||
boundary: _,
|
body: %Tesla.Multipart{
|
||||||
content_type_params: [],
|
boundary: _,
|
||||||
parts: [
|
content_type_params: [],
|
||||||
%Tesla.Multipart.Part{
|
parts: [
|
||||||
body: %File.Stream{
|
%Tesla.Multipart.Part{
|
||||||
line_or_bytes: 2048,
|
body: %File.Stream{
|
||||||
modes: [:raw, :read_ahead, :read, :binary],
|
line_or_bytes: 2048,
|
||||||
path: "some-path/filename.png",
|
modes: [:raw, :read_ahead, :binary],
|
||||||
raw: true
|
path: "some-path/filename.png",
|
||||||
},
|
raw: true
|
||||||
dispositions: [name: "filename.png", filename: "filename.png"],
|
},
|
||||||
headers: []
|
dispositions: [name: "filename.png", filename: "filename.png"],
|
||||||
}
|
headers: []
|
||||||
]
|
}
|
||||||
}
|
]
|
||||||
} = 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 New Issue
Block a user