def search(cls, name, year=None): """Perform a search for an episode with a title matching *title* :param name: The name of the person to search for :param year: Optional year to limit results to """ return search(name, search_type='person', year=year)
def search(cls, title, year=None): """Perform a search for an episode with a title matching *title* :param title: The title to search for :param year: Optional year to limit results to """ return search(title, search_type='episode', year=year)
def search(cls, title, year=None): """Perform a search for the specified *title*. :param title: The title to search for :param year: An optional year for the item you're searching for. """ return search(title, search_type='show', year=year)
def search_all(query: str, search_type=['movie', 'show', 'people']): results = search(query=query, search_type=search_type, slugify_query=True) return results
def search(cls, title, year=None): """Perform a search for the specified *title* :param title: The title to search for """ return search(title, search_type='show', year=year)
def test_search_person(): """test that person search results are successfully returned""" cranston_results = search('cranston', search_type='person') assert isinstance(cranston_results, list) assert all(isinstance(p, Person) for p in cranston_results)
def test_search_episode(): """test that tv episode search results are successfully returned""" batman_results = search('batman', search_type='episode') assert isinstance(batman_results, list) assert all(isinstance(m, TVEpisode) for m in batman_results)
def test_search_show(): """test that tv show search results are successfully returned""" batman_results = search('batman', search_type='show') assert isinstance(batman_results, list) assert all(isinstance(m, TVShow) for m in batman_results)
def test_search_movie_with_year(): batman_results = search('batman', year='1966') assert isinstance(batman_results, list) assert len(batman_results) == 2 assert all(isinstance(m, Movie) for m in batman_results)
def test_search_movie(): """test that movie search results are successfully returned""" batman_results = search('batman') assert isinstance(batman_results, list) assert len(batman_results) == 2 assert all(isinstance(m, Movie) for m in batman_results)
def search(cls, title): """Perform a search for the specified *title* :param title: The title to search for """ return search(title, search_type='show')
def test_search_movie_with_year(): batman_results = search('batman', year='1966') assert isinstance(batman_results, list) assert len(batman_results) == 1 assert all(isinstance(m, Movie) for m in batman_results)