1 defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do
3 alias Pleroma.Web.MediaProxy.Invalidation
5 import ExUnit.CaptureLog
8 on_exit(fn -> Cachex.clear(:deleted_urls_cache) end)
12 test "it logger error when script not found" do
13 assert capture_log(fn ->
14 assert Invalidation.Script.purge(
15 ["http://example.com/media/example.jpg"],
16 script_path: "./example"
17 ) == {:error, "%ErlangError{original: :enoent}"}
18 end) =~ "Error while cache purge: %ErlangError{original: :enoent}"
21 assert Invalidation.Script.purge(
22 ["http://example.com/media/example.jpg"],
24 ) == {:error, "\"not found script path\""}