[video] Update how we get video metadata for YT add
This commit is contained in:
@ -1,11 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from videos.imdb import lookup_video_from_imdb
|
||||
from videos.sources.imdb import lookup_video_from_imdb
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Need to sort out third party API testing")
|
||||
def test_lookup_imdb_bad_id(caplog):
|
||||
data = lookup_video_from_imdb("3409324")
|
||||
assert data is None
|
||||
assert caplog.records[0].levelname == "WARNING"
|
||||
assert caplog.records[0].msg == "IMDB ID should begin with 'tt' 3409324"
|
||||
def test_lookup_imdb():
|
||||
metadata = lookup_video_from_imdb("8946378")
|
||||
assert metadata.title == "Knives Out"
|
||||
|
||||
8
tests/videos_tests/test_youtube.py
Normal file
8
tests/videos_tests/test_youtube.py
Normal file
@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
from videos.sources.youtube import lookup_video_from_youtube
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_lookup_youtube_id():
|
||||
metadata = lookup_video_from_youtube("RZxs9pAv99Y")
|
||||
assert metadata.title == "No Pun Included's Board Game of the Year 2024"
|
||||
Reference in New Issue
Block a user