X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fuploaders%2Fs3_test.exs;h=6950ccb254ef13100a06e22a74d41a4e474c6e43;hb=c255c2e4f5e67a349ee379c8d93d853c12613b15;hp=171316340db8ead0811158546a8be01981447215;hpb=222ac3bcbebe496ba8f0363adea40ef4fcf26886;p=akkoma
diff --git a/test/uploaders/s3_test.exs b/test/uploaders/s3_test.exs
index 171316340..6950ccb25 100644
--- a/test/uploaders/s3_test.exs
+++ b/test/uploaders/s3_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Uploaders.S3Test do
@@ -11,12 +11,11 @@ defmodule Pleroma.Uploaders.S3Test do
import Mock
import ExUnit.CaptureLog
- clear_config([Pleroma.Uploaders.S3]) do
- Config.put([Pleroma.Uploaders.S3],
- bucket: "test_bucket",
- public_endpoint: "https://s3.amazonaws.com"
- )
- end
+ setup do:
+ clear_config(Pleroma.Uploaders.S3,
+ bucket: "test_bucket",
+ public_endpoint: "https://s3.amazonaws.com"
+ )
describe "get_file/1" do
test "it returns path to local folder for files" do
@@ -79,4 +78,11 @@ defmodule Pleroma.Uploaders.S3Test do
end
end
end
+
+ describe "delete_file/1" do
+ test_with_mock "deletes file", ExAws, request: fn _req -> {:ok, %{status_code: 204}} end do
+ assert :ok = S3.delete_file("image.jpg")
+ assert_called(ExAws.request(:_))
+ end
+ end
end