Discord_Elixir_test/test/haha_yes_test.exs

13 lines
535 B
Elixir
Raw Normal View History

2024-10-12 14:38:08 +02:00
defmodule HahaYesTest do
use ExUnit.Case
2024-10-13 17:42:02 +02:00
doctest HahaYes.Utility
2024-10-12 14:38:08 +02:00
2024-10-13 17:42:02 +02:00
@tag :tmp_dir
test "download utils", %{tmp_dir: tmp_dir} do
assert HahaYes.Utility.download("https://x.com/i/status/1844841048603783249", "#{tmp_dir}/test") == {:ok, "#{tmp_dir}/test.mp4"}
assert HahaYes.Utility.download("invalid", "#{tmp_dir}/test") == {:error, "[generic] Extracting URL: invalid\nERROR: [generic] 'invalid' is not a valid URL. Set --default-search \"ytsearch\" (or run yt-dlp \"ytsearch:invalid\" ) to search YouTube\n"}
2024-10-12 14:38:08 +02:00
end
end