37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
|
#!/usr/bin/env python3
|
||
|
import unittest
|
||
|
from tmdb_api import Movie
|
||
|
|
||
|
class TestTmdbMethods(unittest.TestCase):
|
||
|
### TMDB API
|
||
|
def test_search_item(self):
|
||
|
movie = Movie()
|
||
|
id = movie.search_title('Breakfast Club')
|
||
|
self.assertEqual(id, 2108)
|
||
|
|
||
|
def test_cast(self):
|
||
|
movie = Movie()
|
||
|
movie.search_title('Breakfast Club')
|
||
|
self.assertEqual('Anthony Michael Hall', movie.cast[0])
|
||
|
|
||
|
def test_title(self):
|
||
|
movie = Movie()
|
||
|
movie.search_title('Breakfast Club')
|
||
|
self.assertEqual('The Breakfast Club', movie.title)
|
||
|
|
||
|
def test_overview(self):
|
||
|
movie = Movie()
|
||
|
movie.search_title('Breakfast Club')
|
||
|
description = 'Samstag morgen in einer amerikanischen High-School'
|
||
|
self.assertEqual(description, movie.overview[:len(description)])
|
||
|
|
||
|
def test_change_language(self):
|
||
|
movie = Movie()
|
||
|
movie.set_language('en')
|
||
|
movie.search_title('Breakfast Club')
|
||
|
description = 'Five high school students from different walks of life endure a Saturday detention'
|
||
|
self.assertEqual(description, movie.overview[:len(description)])
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main()
|