def generate_sample_ep(multi=None, abd=False, sports=False, anime_type=None): series = Series(indexer=1, indexerid=12345, lang='en') series.name = 'Show Name' series.genre = 'Comedy' if anime_type: series.anime = 1 # make a fake episode object ep = Episode(series=series, season=2, episode=3) ep.status = DOWNLOADED ep.quality = Quality.HDTV ep.airdate = datetime.date(2011, 3, 9) ep.name = 'Ep Name' ep.absolute_number = 13 ep.release_name = 'Show.Name.S02E03.HDTV.x264-RLSGROUP' ep.is_proper = True if abd: ep.release_name = 'Show.Name.2011.03.09.HDTV.x264-RLSGROUP' ep.series.air_by_date = 1 elif sports: ep.release_name = 'Show.Name.2011.03.09.HDTV.x264-RLSGROUP' ep.series.sports = 1 elif anime_type: ep.release_name = 'Show.Name.013.HDTV.x264-RLSGROUP' if multi is not None: ep.name = 'Ep Name (1)' ep.release_name = 'Show.Name.S02E03E04E05.HDTV.x264-RLSGROUP' if anime_type: ep.release_name = 'Show.Name.013-015.HDTV.x264-RLSGROUP' second_ep = Episode(series, 2, 4) second_ep.name = 'Ep Name (2)' second_ep.status = DOWNLOADED second_ep.quality = Quality.HDTV second_ep.absolute_number = 14 second_ep.release_name = ep.release_name third_ep = Episode(series, 2, 5) third_ep.name = 'Ep Name (3)' third_ep.status = DOWNLOADED third_ep.quality = Quality.HDTV third_ep.absolute_number = 15 third_ep.release_name = ep.release_name ep.related_episodes.append(second_ep) ep.related_episodes.append(third_ep) return ep
def generate_sample_ep(multi=None, abd=False, sports=False, anime_type=None): series = Series(indexer=1, indexerid=12345, lang='en') series.name = 'Show Name' series.genre = 'Comedy' if anime_type: series.anime = 1 # make a fake episode object ep = Episode(series=series, season=2, episode=3) ep._status = DOWNLOADED ep.quality = Quality.HDTV ep.airdate = datetime.date(2011, 3, 9) ep.name = 'Ep Name' ep.absolute_number = 13 ep.release_name = 'Show.Name.S02E03.HDTV.x264-RLSGROUP' ep.is_proper = True if abd: ep.release_name = 'Show.Name.2011.03.09.HDTV.x264-RLSGROUP' ep.series.air_by_date = 1 elif sports: ep.release_name = 'Show.Name.2011.03.09.HDTV.x264-RLSGROUP' ep.series.sports = 1 elif anime_type: ep.release_name = 'Show.Name.013.HDTV.x264-RLSGROUP' if multi is not None: ep.name = 'Ep Name (1)' ep.release_name = 'Show.Name.S02E03E04E05.HDTV.x264-RLSGROUP' if anime_type: ep.release_name = 'Show.Name.013-015.HDTV.x264-RLSGROUP' second_ep = Episode(series, 2, 4) second_ep.name = 'Ep Name (2)' second_ep._status = DOWNLOADED second_ep.quality = Quality.HDTV second_ep.absolute_number = 14 second_ep.release_name = ep.release_name third_ep = Episode(series, 2, 5) third_ep.name = 'Ep Name (3)' third_ep._status = DOWNLOADED third_ep.quality = Quality.HDTV third_ep.absolute_number = 15 third_ep.release_name = ep.release_name ep.related_episodes.append(second_ep) ep.related_episodes.append(third_ep) return ep
def setUpClass(cls): """Set up class for tests.""" num_legacy_shows = 3 num_shows = 3 num_episodes_per_show = 5 cls.mydb = db.DBConnection() cls.legacy_shows = [] cls.shows = [] # Per-show-notifications were originally added for email notifications only. To add # this feature to other notifiers, it was necessary to alter the way text is stored in # one of the DB columns. Therefore, to test properly, we must create some shows that # store emails in the old method (legacy method) and then other shows that will use # the new method. for show_counter in range(100, 100 + num_legacy_shows): show = Series(1, show_counter) show.name = "Show " + str(show_counter) show.episodes = [] for episode_counter in range(0, num_episodes_per_show): episode = Episode(show, test.SEASON, episode_counter) episode.name = "Episode " + str(episode_counter + 1) episode.quality = "SDTV" show.episodes.append(episode) show.save_to_db() cls.legacy_shows.append(show) for show_counter in range(200, 200 + num_shows): show = Series(1, show_counter) show.name = "Show " + str(show_counter) show.episodes = [] for episode_counter in range(0, num_episodes_per_show): episode = Episode(show, test.SEASON, episode_counter) episode.name = "Episode " + str(episode_counter + 1) episode.quality = "SDTV" show.episodes.append(episode) show.save_to_db() cls.shows.append(show)
def setUpClass(cls): """Set up class for tests.""" num_legacy_shows = 3 num_shows = 3 num_episodes_per_show = 5 cls.mydb = db.DBConnection() cls.legacy_shows = [] cls.shows = [] # Per-show-notifications were originally added for email notifications only. To add # this feature to other notifiers, it was necessary to alter the way text is stored in # one of the DB columns. Therefore, to test properly, we must create some shows that # store emails in the old method (legacy method) and then other shows that will use # the new method. for show_counter in list(range(100, 100 + num_legacy_shows)): show = Series(1, show_counter) show.name = "Show " + text_type(show_counter) show.episodes = [] for episode_counter in list(range(0, num_episodes_per_show)): episode = Episode(show, test.SEASON, episode_counter) episode.name = "Episode " + text_type(episode_counter + 1) episode.quality = "SDTV" show.episodes.append(episode) show.save_to_db() cls.legacy_shows.append(show) for show_counter in list(range(200, 200 + num_shows)): show = Series(1, show_counter) show.name = "Show " + text_type(show_counter) show.episodes = [] for episode_counter in list(range(0, num_episodes_per_show)): episode = Episode(show, test.SEASON, episode_counter) episode.name = "Episode " + text_type(episode_counter + 1) episode.quality = "SDTV" show.episodes.append(episode) show.save_to_db() cls.shows.append(show)