-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
38 lines (28 loc) · 955 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import unittest
from api import get_top_250_movies, get_top_250_series, search_movie, search_series
API_KEY = input('insert your api_key:\n')
class TestMovies(unittest.TestCase):
def test_top_movies(self):
'''
Check response type is list or not.
'''
result = get_top_250_movies(API_KEY)
self.assertIsInstance(result, list)
def test_top_series(self):
'''
Check response type is list or not.
'''
result = get_top_250_series(API_KEY)
self.assertIsInstance(result, list)
def test_search_movie(self):
'''
Check response type is list or not.
'''
result = search_movie(API_KEY, 'inception')
self.assertIsInstance(result, list)
def test_search_series(self):
'''
Check response type is list or not.
'''
result = search_series(API_KEY, 'lost')
self.assertIsInstance(result, list)