Test download util
This commit is contained in:
parent
4c8d48c575
commit
ef6828531b
1 changed files with 7 additions and 3 deletions
|
@ -1,8 +1,12 @@
|
|||
defmodule HahaYesTest do
|
||||
use ExUnit.Case
|
||||
doctest HahaYes
|
||||
doctest HahaYes.Utility
|
||||
|
||||
test "greets the world" do
|
||||
assert HahaYes.hello() == :world
|
||||
@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"}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue