X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fobject%2Ffetcher_test.exs;h=26dc9496deb5c609617d518c789912eaf9604a8d;hb=89fead9250a5bd9b6712a285e8a827f1aec69615;hp=58abcfe5522ac26414137988b4df9d547ca22c64;hpb=afae3ada22fb714735fd75448c574276353f2e1d;p=akkoma diff --git a/test/object/fetcher_test.exs b/test/object/fetcher_test.exs index 58abcfe55..26dc9496d 100644 --- a/test/object/fetcher_test.exs +++ b/test/object/fetcher_test.exs @@ -11,6 +11,9 @@ defmodule Pleroma.Object.FetcherTest do %{method: :get, url: "https://mastodon.example.org/users/userisgone"} -> %Tesla.Env{status: 410} + %{method: :get, url: "https://mastodon.example.org/users/userisgone404"} -> + %Tesla.Env{status: 404} + env -> apply(HttpRequestMock, :request, [env]) end) @@ -100,6 +103,13 @@ defmodule Pleroma.Object.FetcherTest do "https://mastodon.example.org/users/userisgone" ) end + + test "handle HTTP 404 response" do + assert {:error, "Object has been deleted"} == + Fetcher.fetch_and_contain_remote_object_from_id( + "https://mastodon.example.org/users/userisgone404" + ) + end end describe "pruning" do