X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=inline;f=test%2Fpleroma%2Fhttp%2Frequest_builder_test.exs;h=433beaac113f3e7c3fd87eba42f4931ec1cfa9b3;hb=7aebff799b57d27d97f7830fd7c3ef27875c33fe;hp=fab909905d133936d186bf0d754ffcb65043c01c;hpb=073ad7e6d91884f3c972f903d936f029c7a884e6;p=akkoma
diff --git a/test/pleroma/http/request_builder_test.exs b/test/pleroma/http/request_builder_test.exs
index fab909905..433beaac1 100644
--- a/test/pleroma/http/request_builder_test.exs
+++ b/test/pleroma/http/request_builder_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.RequestBuilderTest do
@@ -34,24 +34,32 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
describe "add_param/4" do
test "add file parameter" do
- %Request{
- body: %Tesla.Multipart{
- boundary: _,
- content_type_params: [],
- parts: [
- %Tesla.Multipart.Part{
- body: %File.Stream{
- line_or_bytes: 2048,
- modes: [:raw, :read_ahead, :read, :binary],
- path: "some-path/filename.png",
- raw: true
- },
- dispositions: [name: "filename.png", filename: "filename.png"],
- headers: []
- }
- ]
- }
- } = RequestBuilder.add_param(%Request{}, :file, "filename.png", "some-path/filename.png")
+ assert match?(
+ %Request{
+ body: %Tesla.Multipart{
+ boundary: _,
+ content_type_params: [],
+ parts: [
+ %Tesla.Multipart.Part{
+ body: %File.Stream{
+ line_or_bytes: 2048,
+ modes: [:raw, :read_ahead, :binary],
+ path: "some-path/filename.png",
+ raw: true
+ },
+ dispositions: [name: "filename.png", filename: "filename.png"],
+ headers: []
+ }
+ ]
+ }
+ },
+ RequestBuilder.add_param(
+ %Request{},
+ :file,
+ "filename.png",
+ "some-path/filename.png"
+ )
+ )
end
test "add key to body" do