copy tmp file if test depends on it

This commit is contained in:
Alexander Strizhakov 2020-07-21 10:31:58 +03:00
parent af376cbffb
commit 6afc6717d6
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
2 changed files with 4 additions and 0 deletions

View file

@ -9,6 +9,8 @@ defmodule Pleroma.Upload.Filter.AnonymizeFilenameTest do
alias Pleroma.Upload alias Pleroma.Upload
setup do setup do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
upload_file = %Upload{ upload_file = %Upload{
name: "an… image.jpg", name: "an… image.jpg",
content_type: "image/jpg", content_type: "image/jpg",

View file

@ -14,6 +14,7 @@ test "it returns path to local folder for files" do
describe "put_file/1" do describe "put_file/1" do
test "put file to local folder" do test "put file to local folder" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
file_path = "local_upload/files/image.jpg" file_path = "local_upload/files/image.jpg"
file = %Pleroma.Upload{ file = %Pleroma.Upload{
@ -32,6 +33,7 @@ test "put file to local folder" do
describe "delete_file/1" do describe "delete_file/1" do
test "deletes local file" do test "deletes local file" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
file_path = "local_upload/files/image.jpg" file_path = "local_upload/files/image.jpg"
file = %Pleroma.Upload{ file = %Pleroma.Upload{