def test_get_cast_filmographies(): cache_popularities(1,1) production, cf = get_cast_filmographies('the martian') assert production['title'] == 'The Martian' assert cf[0]['role']['character'] == 'Mark Watney' assert cf[0]['role']['name'] == 'Matt Damon' movies = [production['title'] for production in \ cf[0]['filmography'] if production['media_type'] == 'movie'] assert 'Interstellar' in movies tv_shows = [production['name'] for production in \ cf[0]['filmography'] if production['media_type'] == 'tv'] assert 'De Wereld Draait Door' in tv_shows
from miner.themoviedb import get_cast_filmographies from collections import OrderedDict import json cf = get_cast_filmographies("the martian") with open('the_martian_cast_filmographies.json', 'w') as f: json.dump(cf, f, indent=4)