def testShowWithoutEpisodeNumWithoutSubtitleWithoutDetails(self): channel = Channel("x", "x", "x") title = u"Uwaga" category = "magazyn reporterów" desc = "One line summary." main_category = "Show/Game show" time_start = "2013-01-02 02:10:00" time_end = "2013-01-02 03:50:00" url = None parser_options = ParserOptions( split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with original title and year parser_options = ParserOptions( split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=18 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with year parser_options = ParserOptions( split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=18 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with original title parser_options = ParserOptions( split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # nothing parser_options = ParserOptions( split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=12 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with original title, year and age parser_options = ParserOptions( split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=12 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with year and age parser_options = ParserOptions( split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=12 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with original title and age parser_options = ParserOptions( split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=12 ) event = TelemanEvent( parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None ) self.assertEqual(event.get_title(), u"Uwaga") # with age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_description(), "One line summary.")
def testShowWithSubtitleWithDetails(self): imdb_url = u"x" imdb_rank = u"x" imdb = Imdb(imdb_url, imdb_rank) filmweb_url = u"x" filmweb_rank = u"x" filmweb = Imdb(filmweb_url, filmweb_rank) photo_url = u"x" channel = Channel('x', 'x', "x") title = u'Rodzinka.pl: Zachcianki (80)' category = 'serial komediowy' desc = 'One line summary.' primary_title = u'Rodzinka.pl: Zachcianki (80)' secondary_title = None original_title = None genre = u"serial komediowy" country = u"Polska" year = u"2013" pg = ParentalRating(u"od 12 lat", 12) description = u"Long description" details = TelemanEventDetails(primary_title, secondary_title, description, original_title, year, country, genre, imdb, filmweb, photo_url, pg) main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual( event.get_title(), u'Rodzinka.pl: Zachcianki (80)') # with original title and year self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Rodzinka.pl: Zachcianki (80)') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Rodzinka.pl') # with original title and year self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") self.assertEqual(event.get_filename(), u'Rodzinka.pl (80) Zachcianki') parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Rodzinka.pl') # with year self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") self.assertEqual(event.get_filename(), u'Rodzinka.pl (80) Zachcianki') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Rodzinka.pl') # with original title self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Rodzinka.pl') # nothing self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual( event.get_title(), u'Rodzinka.pl [od 12 lat]') # with original title, year and age self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=12) self.assertEqual(event.get_title(), u'Rodzinka.pl [od 12 lat]') # with year and age self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=12) self.assertEqual( event.get_title(), u'Rodzinka.pl [od 12 lat]') # with original title and age self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=12) self.assertEqual(event.get_title(), u'Rodzinka.pl [od 12 lat]') # with age self.assertEqual(event.get_subtitle(), "Zachcianki") self.assertEqual(event.get_episode_num(), "80") self.assertEqual(event.get_description(), u'One line summary.Long description')
def testShowWithEpisodeNumWithoutSubtitleWithoutDetails(self): channel = Channel('x','x',"x") title = u'Barwy szczęścia (948)' category = 'serial obyczajowy' desc = 'One line summary.' main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)') # with original title and year self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)') # with year self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)') # with original title self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)')# nothing self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)')# with original title, year and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)')# with year and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)') # with original title and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia (948)') # with age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia') # with original title and year self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia') # with year self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia') # with original title self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia')# nothing self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia')# with original title, year and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia')# with year and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia') # with original title and age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') parser_options = ParserOptions(split_title = True, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Barwy szczęścia') # with age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), "948") self.assertEqual(event.get_filename(), u'Barwy szczęścia (948)') self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_description(), "One line summary.")
def testShow3(self): imdb_url = u"x" imdb_rank = u"x" imdb = Imdb(imdb_url, imdb_rank) filmweb_url = u"x" filmweb_rank = u"x" filmweb = Imdb(filmweb_url, filmweb_rank) photo_url = u"x" channel = Channel('x', 'x', "x") title = u'Na linii strzału 2 (15)' category = 'serial sensacyjny' desc = 'One line summary.' primary_title = 'Na linii strzału' secondary_title = 'sezon 2 odc. 15' original_title = "In Plain Sight: In My Humboldt Opinion" genre = u"serial sensacyjny" country = u"USA" year = u"2009" pg = ParentalRating(u"od 16 lat", 16) description = u"Long description" details = TelemanEventDetails(primary_title, secondary_title, description, original_title, year, country, genre, imdb, filmweb, photo_url, pg) main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title( ), u'In Plain Sight: In My Humboldt Opinion - Na linii strza\u0142u 2 (15)' ) # with original title and year parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strza\u0142u 2 (15)') # with year parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual( event.get_title(), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15)' ) # with original title parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strzału 2 (15)') # nothing parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title( ), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15) [od 16 lat]' ) # with original title, year and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual( event.get_title(), u'Na linii strzału 2 (15) [od 16 lat]') # with year and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title( ), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15) [od 16 lat]' ) # with original title and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strzału 2 (15) [od 16 lat]') # with age parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_subtitle(), None) self.assertEqual( event.get_description(), "One line summary.Long description\nTytul oryginalny:In Plain Sight: In My Humboldt Opinion" )
def testShowWithoutEpisodeNumWithoutSubtitleWithoutDetails(self): channel = Channel('x', 'x', "x") title = u'Uwaga' category = 'magazyn reporterów' desc = 'One line summary.' main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with original title and year parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with year parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with original title parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # nothing parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with original title, year and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with year and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with original title and age parser_options = ParserOptions(split_title=False, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=None) self.assertEqual(event.get_title(), u'Uwaga') # with age self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_description(), "One line summary.")
def testShow3(self): imdb_url = u"x" imdb_rank = u"x" imdb = Imdb(imdb_url, imdb_rank) filmweb_url = u"x" filmweb_rank = u"x" filmweb = Imdb(filmweb_url, filmweb_rank) photo_url = u"x" channel = Channel('x','x',"x") title = u'Na linii strzału 2 (15)' category = 'serial sensacyjny' desc = 'One line summary.' primary_title = 'Na linii strzału' secondary_title = 'sezon 2 odc. 15' original_title = "In Plain Sight: In My Humboldt Opinion" genre = u"serial sensacyjny" country = u"USA" year = u"2009" pg = ParentalRating(u"od 16 lat", 16) description = u"Long description" details = TelemanEventDetails(primary_title, secondary_title, description, original_title, year, country, genre, imdb, filmweb, photo_url, pg) main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'In Plain Sight: In My Humboldt Opinion - Na linii strza\u0142u 2 (15)') # with original title and year parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strza\u0142u 2 (15)') # with year parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15)') # with original title parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strzału 2 (15)')# nothing parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15) [od 16 lat]')# with original title, year and age parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = True, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strzału 2 (15) [od 16 lat]')# with year and age parser_options = ParserOptions(split_title = False, add_original_title_to_title = True, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'In Plain Sight: In My Humboldt Opinion - Na linii strzału 2 (15) [od 16 lat]') # with original title and age parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na linii strzału 2 (15) [od 16 lat]') # with age parser_options = ParserOptions(split_title = False, add_original_title_to_title = False, add_year_to_title = False, add_age_rating_to_title = 18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_description(), "One line summary.Long description\nTytul oryginalny:In Plain Sight: In My Humboldt Opinion")
def testShowWithDetailsWithSecondaryTitle(self): imdb_url = u"x" imdb_rank = u"x" imdb = Imdb(imdb_url, imdb_rank) filmweb_url = u"x" filmweb_rank = u"x" filmweb = Imdb(filmweb_url, filmweb_rank) photo_url = u"x" channel = Channel('x', 'x', "x") title = u'Na dobre i na złe: Pierwszy dzień (518)' category = 'serial obyczajowy' desc = 'One line summary.' primary_title = u'Na dobre i na złe' secondary_title = u'odc. 518: Pierwszy dzień' original_title = None genre = u"serial obyczajowy" country = u"Polska" year = u"2013" pg = ParentalRating(u"od 12 lat", 12) description = u"Long description" details = TelemanEventDetails(primary_title, secondary_title, description, original_title, year, country, genre, imdb, filmweb, photo_url, pg) main_category = 'Show/Game show' time_start = '2013-01-02 02:10:00' time_end = '2013-01-02 03:50:00' url = None parser_options = ParserOptions(split_title=False, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe: Pierwszy dzień (518)') self.assertEqual(event.get_subtitle(), None) self.assertEqual(event.get_episode_num(), None) self.assertEqual(event.get_filename(), u'Na dobre i na złe: Pierwszy dzień (518)') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe') # with original title and year self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe') # with year self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe') # with original title self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=18) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe') # nothing self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe [od 12 lat]') # with original title, year and age self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe [od 12 lat] (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=True, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe [od 12 lat]') # with year and age self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe [od 12 lat] (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=True, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe [od 12 lat]') # with original title and age self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe [od 12 lat] (518) Pierwszy dzień') parser_options = ParserOptions(split_title=True, add_original_title_to_title=False, add_year_to_title=False, add_age_rating_to_title=12) event = TelemanEvent(parser_options, channel, title, main_category, category, desc, time_start, time_end, url, details=details) self.assertEqual(event.get_title(), u'Na dobre i na złe [od 12 lat]') # with age self.assertEqual(event.get_subtitle(), u"Pierwszy dzień") self.assertEqual(event.get_episode_num(), "518") self.assertEqual(event.get_filename(), u'Na dobre i na złe [od 12 lat] (518) Pierwszy dzień') self.assertEqual(event.get_description(), u'One line summary.Long description')