First tests for imdb module
This commit is contained in:
@ -3,3 +3,5 @@ omit=
|
||||
vrobbler/wsgi.py
|
||||
vrobbler/asgi.py
|
||||
vrobbler/cli.py
|
||||
*admin.py
|
||||
migrations/*
|
||||
|
||||
12
tests/scrobbles_tests/test_imdb.py
Normal file
12
tests/scrobbles_tests/test_imdb.py
Normal file
@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
import imdb
|
||||
from mock import patch
|
||||
|
||||
from vrobbler.apps.scrobbles.imdb import lookup_video_from_imdb
|
||||
|
||||
|
||||
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"
|
||||
@ -2,10 +2,10 @@ import logging
|
||||
from typing import Optional
|
||||
from django.utils import timezone
|
||||
|
||||
import imdb
|
||||
from imdb import Cinemagoer
|
||||
from videos.models import Video
|
||||
|
||||
imdb_client = imdb.Cinemagoer()
|
||||
imdb_client = Cinemagoer()
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user