From: Mark Felder Date: Tue, 8 Jun 2021 19:02:56 +0000 (-0500) Subject: Add test for AnalyzeMetadata upload filter fetching dimensions from a video X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=1c4c73c6a0c95ecb75d4048f52bedc511f0d4b66;p=akkoma Add test for AnalyzeMetadata upload filter fetching dimensions from a video --- diff --git a/test/fixtures/video.mp4 b/test/fixtures/video.mp4 new file mode 100644 index 000000000..2021e3a5b Binary files /dev/null and b/test/fixtures/video.mp4 differ diff --git a/test/pleroma/upload/filter/analyze_metadata_test.exs b/test/pleroma/upload/filter/analyze_metadata_test.exs index 6f0e432ef..488743952 100644 --- a/test/pleroma/upload/filter/analyze_metadata_test.exs +++ b/test/pleroma/upload/filter/analyze_metadata_test.exs @@ -16,4 +16,15 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do assert {:ok, :filtered, %{width: 1024, height: 768}} = AnalyzeMetadata.filter(upload) end + + test "adds the video dimensions" do + upload = %Pleroma.Upload{ + name: "coolvideo.mp4", + content_type: "video/mp4", + path: Path.absname("test/fixtures/video.mp4"), + tempfile: Path.absname("test/fixtures/video.mp4") + } + + assert {:ok, :filtered, %{width: 480, height: 480}} = AnalyzeMetadata.filter(upload) + end end