1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.HTTP.ExAwsTest do
11 @url "https://s3.amazonaws.com/test_bucket/test_image.jpg"
15 %{method: :get, url: @url, headers: [{"x-amz-bucket-region", "us-east-1"}]} ->
18 body: "image-content",
19 headers: [{"x-amz-bucket-region", "us-east-1"}]
22 %{method: :post, url: @url, body: "image-content-2"} ->
23 %Tesla.Env{status: 200, body: "image-content-2"}
31 assert HTTP.ExAws.request(:get, @url, "", [{"x-amz-bucket-region", "us-east-1"}]) == {
34 body: "image-content",
35 headers: [{"x-amz-bucket-region", "us-east-1"}],
42 assert HTTP.ExAws.request(:post, @url, "image-content-2", [
43 {"x-amz-bucket-region", "us-east-1"}
47 body: "image-content-2",