Add test for AnalyzeMetadata upload filter fetching dimensions from a video

This commit is contained in:
Mark Felder 2021-06-08 14:02:56 -05:00
parent 8443f82247
commit 1c4c73c6a0
2 changed files with 11 additions and 0 deletions

BIN
test/fixtures/video.mp4 vendored Normal file

Binary file not shown.

View File

@ -16,4 +16,15 @@ test "adds the image dimensions" 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