def test_sceneExceptionByNameAnime(self): sickbeard.showList = None sickbeard.showList = [Show(1, 79604), Show(1, 295243)] sickbeard.showList[0].anime = 1 sickbeard.showList[1].anime = 1 scene_exceptions.retrieve_exceptions() name_cache.buildNameCache() self.assertEqual(scene_exceptions.get_scene_exception_by_name(u'ブラック・ラグーン'), [79604, -1]) self.assertEqual(scene_exceptions.get_scene_exception_by_name(u'Burakku Ragūn'), [79604, -1]) self.assertEqual(scene_exceptions.get_scene_exception_by_name('Rokka no Yuusha'), [295243, -1])
def _test_allPossibleShowNames(self, name, indexerid=0, expected=[]): s = Show(1, indexerid) s.name = name result = show_name_helpers.allPossibleShowNames(s) self.assertTrue( len(set(expected).intersection(set(result))) == len(expected))
def _test_allPossibleShowNames(self, name, tvdbid=0, tvrname=None, expected=[]): s = Show(tvdbid) s.name = name s.tvrname = tvrname result = show_name_helpers.allPossibleShowNames(s) self.assertTrue(len(set(expected).intersection(set(result))) == len(expected))
def setUp(self): sickbeard.QUALITY_DEFAULT = 2 self.show = Show(1, 1) sickbeard.REQUIRE_WORDS = 'REQUIRED' sickbeard.IGNORE_WORDS = 'IGNORED' # These are opposite of global, to prove they override self.show.rls_ignore_words = 'REQUIRED' self.show.rls_require_words = 'IGNORED'
def test_isGoodName(self): listOfcases = [('Show.Name.S01E02.Test-Test', 'Show/Name'), ('Show.Name.S01E02.Test-Test', 'Show. Name'), ('Show.Name.S01E02.Test-Test', 'Show- Name'), ('Show.Name.Part.IV.Test-Test', 'Show Name'), ('Show.Name.S01.Test-Test', 'Show Name'), ('Show.Name.E02.Test-Test', 'Show: Name'), ('Show Name Season 2 Test', 'Show: Name'), ] for testCase in listOfcases: scene_name, show_name = testCase s = Show(0) s.name = show_name self._test_isGoodName(scene_name, s)
def _test_all_possible_show_names(self, name, indexerid=0, expected=None): """ Test all possible show names :param name: :param indexerid: :param expected: :return: """ expected = [] if expected is None else expected show = Show(1, indexerid) show.name = name result = show_name_helpers.allPossibleShowNames(show) self.assertTrue(len(set(expected).intersection(set(result))) == len(expected))
def _test_allPossibleShowNames(self, name, tvdbid=0, tvrname=None, expected=[]): s = Show(tvdbid) s.name = name s.tvrname = tvrname result = show_name_helpers.allPossibleShowNames(s) result = [unicode(x) for x in sorted(result)] expected = [unicode(x) for x in sorted(expected)] #self.assertEqual(len(set(expected).intersection(set(result))), len(expected)) self.assertEqual(result, expected)
def test_is_good_name(self): """ Perform good name tests """ list_of_cases = [ ('Show.Name.S01E02.Test-Test', 'Show/Name'), ('Show.Name.S01E02.Test-Test', 'Show. Name'), ('Show.Name.S01E02.Test-Test', 'Show- Name'), ('Show.Name.Part.IV.Test-Test', 'Show Name'), ('Show.Name.S01.Test-Test', 'Show Name'), ('Show.Name.E02.Test-Test', 'Show: Name'), ('Show Name Season 2 Test', 'Show: Name'), ] for test_case in list_of_cases: scene_name, show_name = test_case show = Show(1, 0) show.name = show_name self._test_is_good_name(scene_name, show)
def setUp(self): super(SceneExceptionTestCase, self).setUp() sickbeard.showList = [Show(1, 79604), Show(1, 251085)] scene_exceptions.retrieve_exceptions() name_cache.buildNameCache()