mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-30 04:14:57 +00:00
BackupTest: Fix s3 test.
This commit is contained in:
parent
ba234d3c73
commit
fd9a0ac329
|
@ -195,7 +195,6 @@ defmodule Pleroma.User.BackupTest do
|
||||||
|
|
||||||
describe "it uploads and deletes a backup archive" do
|
describe "it uploads and deletes a backup archive" do
|
||||||
setup do
|
setup do
|
||||||
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.S3)
|
|
||||||
clear_config([Pleroma.Upload, :base_url], "https://s3.amazonaws.com")
|
clear_config([Pleroma.Upload, :base_url], "https://s3.amazonaws.com")
|
||||||
clear_config([Pleroma.Uploaders.S3, :bucket], "test_bucket")
|
clear_config([Pleroma.Uploaders.S3, :bucket], "test_bucket")
|
||||||
|
|
||||||
|
@ -216,7 +215,8 @@ defmodule Pleroma.User.BackupTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "S3", %{path: path, backup: backup} do
|
test "S3", %{path: path, backup: backup} do
|
||||||
Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.S3)
|
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.S3)
|
||||||
|
clear_config([Pleroma.Uploaders.S3, :streaming_enabled], false)
|
||||||
|
|
||||||
with_mock ExAws,
|
with_mock ExAws,
|
||||||
request: fn
|
request: fn
|
||||||
|
@ -226,13 +226,10 @@ defmodule Pleroma.User.BackupTest do
|
||||||
assert {:ok, %Pleroma.Upload{}} = Backup.upload(backup, path)
|
assert {:ok, %Pleroma.Upload{}} = Backup.upload(backup, path)
|
||||||
assert {:ok, _backup} = Backup.delete(backup)
|
assert {:ok, _backup} = Backup.delete(backup)
|
||||||
end
|
end
|
||||||
|
|
||||||
with_mock ExAws, request: fn %{http_method: :delete} -> {:ok, %{status_code: 204}} end do
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "Local", %{path: path, backup: backup} do
|
test "Local", %{path: path, backup: backup} do
|
||||||
Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||||
|
|
||||||
assert {:ok, %Pleroma.Upload{}} = Backup.upload(backup, path)
|
assert {:ok, %Pleroma.Upload{}} = Backup.upload(backup, path)
|
||||||
assert {:ok, _backup} = Backup.delete(backup)
|
assert {:ok, _backup} = Backup.delete(backup)
|
||||||
|
|
Loading…
Reference in a new issue