request_builder_test: mode :read got removed

This commit is contained in:
Haelwenn (lanodan) Monnier 2021-05-31 10:14:12 +02:00
parent 5c3a0dd26e
commit 24d66b60a0
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

View file

@ -34,24 +34,32 @@ 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
%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