class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() # Season #/E## def test_FileParser_single_case_001(self): KnownValues.File_SxxExx["FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 1/E01 Case 001.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_002(self): KnownValues.File_SxxExx["FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 01/E01 Case 002.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_003(self): KnownValues.File_SxxExx["FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 1/E001 Case 003.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_004(self): KnownValues.File_SxxExx["FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 01/E001 Case 004.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_005(self): KnownValues.File_SxxExx["FileName"] = "/Series/Covert Affairs/Season 1/E01 Case 005.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) self.library = FileParser() args = self.library.options.parser.parse_args('--error')
def __init__(self): log.trace('__init__ method: Started') super(DownloadDatabase, self).__init__() self.db = sqlite3.connect(self.settings.DBFile) self.cursor = self.db.cursor() self.fileparser = FileParser()
def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) # logger.start(level=ERROR) self.library = FileParser()
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() # Season #/E## def test_FileParser_single_case_001(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 1/E01 Case 001.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_002(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 01/E01 Case 002.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_003(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 1/E001 Case 003.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_004(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/DadVision/Series/Covert Affairs/Season 01/E001 Case 004.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_005(self): KnownValues.File_SxxExx[ "FileName"] = "/Series/Covert Affairs/Season 1/E01 Case 005.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
def __init__(self): log.trace('__init__ method: Started') super(seriesInfo, self).__init__() seriesinfo_group = self.options.parser.add_argument_group("Episode Detail Options", description=None) seriesinfo_group.add_argument("--sn", "--name", type=str, dest='series_name') seriesinfo_group.add_argument("--season", type=int, dest='season') seriesinfo_group.add_argument("--epno", type=int, action='append', dest='epno') seriesinfo_group.add_argument("--series-only", "--so", dest="get_episodes", action="store_false", default=False, help="Information to come from MyTrakt.tv") ''' seriesinfo_group.add_argument("--tvdb", dest="processes", action="append_const", const='tvdb', help="Information to come from TVDB") seriesinfo_group.add_argument("--tvrage", dest="processes", action="append_const", const='tvrage', help="Information to come from TVRage") seriesinfo_group.add_argument("--MyTrakt", dest="processes", action="append_const", const='MyTrakt', help="Information to come from MyTrakt.tv") ''' self.parser = FileParser() self.regex_repack = re.compile('^.*(repack|proper).*$', re.IGNORECASE) self.check_suffix = re.compile('^(?P<seriesname>.+?)[ \._\-](?P<year>[0-9][0-9][0-9][0-9]|US|us|Us)$', re.VERBOSE) self.regex_SeriesDir = re.compile('^{}.*$'.format(self.settings.SeriesDir), re.IGNORECASE) self.selected_file = None return
def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser()
def __init__(self): log.trace('__init__ method: Started') super(CleanDatabase, self).__init__() self.db = sqlite3.connect(self.settings.DBFile) self.cursor = self.db.cursor() self.directory_old = '/mnt/DadVision/Series' self.re_dir_old = re.compile('^{}.*$'.format(self.directory_old), re.IGNORECASE) self.re_dir_current = re.compile( '^{}.*$'.format(self.settings.SeriesDir), re.IGNORECASE) self.fileparser = FileParser()
pp = pprint.PrettyPrinter(indent=1, depth=1) print "-" * 60 pp.pprint(answer) print "-" * 60 if __name__ == "__main__": logger.initialize() log.trace("MAIN: -------------------------------------------------") from series import FileParser import pprint library = SeriesInfo() parser = FileParser() __main__group = library.options.parser.add_argument_group("Get SeriesInfo Information Options", description=None) __main__group.add_argument( "--Error-Log", dest="errorlog", action="store_true", default=False, help="Create Seperate Log for Errors" ) Library.args = library.options.parser.parse_args(sys.argv[1:]) log.debug("Parsed command line: {!s}".format(library.args)) log_level = logging.getLevelName(library.args.loglevel.upper()) if library.args.logfile == "daddyvision.log": log_file = "{}.log".format(__pgmname__) else: log_file = os.path.expanduser(library.args.logfile)
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 Covert Affairs ... 02 Covert.Affairs. ... 03 Covert_Affairs_ ... ''' # 01 Covert Affairs ... def test_FileParser_single_case_011(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 1 Episode 01 Case 011.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_012(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 01 Episode 01 Case 012.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_013(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 1 Episode 001 Case 013.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_014(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 01 Episode 001 Case 014.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 Covert.Affairs. ... def test_FileParser_single_case_021(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.1.Episode.01.Case.021.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_022(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.01.Episode.01.Case.022.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_023(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.1.Episode.001.Case.023.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_024(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.01.Episode.001.Case.024.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 Covert_Affairs_ ... def test_FileParser_single_case_031(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_1_Episode_01_Case_031.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_032(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_01_Episode_01_Case_032.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_033(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_1_Episode_001_Case_033.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_034(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_01_Episode_001_Case_034.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 Covert Affairs ... 02 Covert.Affairs. ... 03 Covert_Affairs_ ... ''' # 01 Covert Affairs ... def test_FileParser_single_case_001(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 101 Case 006.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_002(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 0101 Case 007.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_single_case_003(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1001 Case 008.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_004(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01001 Case 009.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 Covert.Affairs. ... def test_FileParser_single_case_021(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.101.Title.ext Case 026.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_022(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.0101.Title.ext Case 027.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_single_case_023(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.1001.Title.ext Case 028.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_024(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.01001.Title.ext Case 029.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 Covert_Affairs_ ... def test_FileParser_single_case_031(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_101_Title.ext Case 046.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_032(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_0101_Title.ext Case 047.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_single_case_033(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_1001_Title.ext Case 048.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_034(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_01001_Title.ext Case 049.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class DownloadDatabase(Library): def __init__(self): log.trace('__init__ method: Started') super(DownloadDatabase, self).__init__() self.db = sqlite3.connect(self.settings.DBFile) self.cursor = self.db.cursor() self.fileparser = FileParser() def ScanSeriesLibrary(self): log.trace('ScanSeriesLibrary: Start') FilesToBeAdded = [] Files_Loaded = 0 Files_Processed = 0 Files_Already_Processed = 0 Files_Non_Video = 0 Files_with_Errors = 0 File_Count = countFiles(self.settings.SeriesDir, exclude_list=self.settings.ExcludeList) log.info('Number of File to be Checked: %s' % File_Count) for _root, _dirs, _files in os.walk(self.settings.SeriesDir): if _dirs is not None: _dirs.sort() for _dir in _dirs[:]: # Process Enbedded Directories if self._ignored(_dir): _dirs.remove(_dir) for _file_name in _files: quotient, remainder = divmod(Files_Processed, 250) if remainder == 0: self.db.commit() log.info('Checked: %2.2f%% - %5s of %5s Errors: %s Present: %s Non-Video: %s ' \ % ((Files_Processed/ File_Count)*100, Files_Processed, File_Count, Files_with_Errors, Files_Already_Processed, Files_Non_Video ) ) Files_Processed += 1 _fq_name = os.path.join(_root, _file_name) log.trace('Processing File: %s' % _fq_name) try: _ext = os.path.splitext(_file_name)[1][1:] if _ext not in self.settings.MediaExt: Files_Non_Video += 1 continue _file_details = self.fileparser.getFileDetails(_fq_name) self.load_entry(_file_details) Files_Loaded += 1 except InvalidFilename: log.info('Skipping Series Not Found: {}'.format(_fq_name)) Files_with_Errors += 1 continue except DuplicateRecord: Files_Already_Processed += 1 continue self.db.commit() log.info('Complete: Files Checked: %5s Number of Errors: %s' % (Files_Processed, Files_with_Errors ) ) def load_entry(self, file_details): # t = os.path.getmtime(file_details['FileName']) # timestamp = datetime.datetime.fromtimestamp(t) try: # SQL # self.cursor.execute('INSERT INTO Files(SeriesName, SeasonNum, EpisodeNum, Filename) \ VALUES ("{}", {}, {}, "{}")'.format(file_details['SeriesName'], file_details['SeasonNum'], file_details['EpisodeNums'][0], file_details['FileName'] ) ) file_id = int(self.cursor.lastrowid) except sqlite3.IntegrityError, e: raise DuplicateRecord except sqlite3.Error, e: raise UnexpectedErrorOccured("File Information Insert: {} {}".format(e, file_details))
class DownloadDatabase(Library): def __init__(self): log.trace('__init__ method: Started') super(DownloadDatabase, self).__init__() self.db = sqlite3.connect(self.settings.DBFile) self.cursor = self.db.cursor() self.fileparser = FileParser() def ScanSeriesLibrary(self): log.trace('ScanSeriesLibrary: Start') FilesToBeAdded = [] Files_Loaded = 0 Files_Processed = 0 Files_Already_Processed = 0 Files_Non_Video = 0 Files_with_Errors = 0 File_Count = countFiles(self.settings.SeriesDir, exclude_list=self.settings.ExcludeList) log.info('Number of File to be Checked: %s' % File_Count) for _root, _dirs, _files in os.walk(self.settings.SeriesDir): if _dirs is not None: _dirs.sort() for _dir in _dirs[:]: # Process Enbedded Directories if self._ignored(_dir): _dirs.remove(_dir) for _file_name in _files: quotient, remainder = divmod(Files_Processed, 250) if remainder == 0: self.db.commit() log.info('Checked: %2.2f%% - %5s of %5s Errors: %s Present: %s Non-Video: %s ' \ % ((Files_Processed/ File_Count)*100, Files_Processed, File_Count, Files_with_Errors, Files_Already_Processed, Files_Non_Video ) ) Files_Processed += 1 _fq_name = os.path.join(_root, _file_name) log.trace('Processing File: %s' % _fq_name) try: _ext = os.path.splitext(_file_name)[1][1:] if _ext not in self.settings.MediaExt: Files_Non_Video += 1 continue _file_details = self.fileparser.getFileDetails(_fq_name) self.load_entry(_file_details) Files_Loaded += 1 except InvalidFilename: log.info('Skipping Series Not Found: {}'.format(_fq_name)) Files_with_Errors += 1 continue except DuplicateRecord: Files_Already_Processed += 1 continue self.db.commit() log.info('Complete: Files Checked: %5s Number of Errors: %s' % (Files_Processed, Files_with_Errors)) def load_entry(self, file_details): # t = os.path.getmtime(file_details['FileName']) # timestamp = datetime.datetime.fromtimestamp(t) try: # SQL # self.cursor.execute( 'INSERT INTO Files(SeriesName, SeasonNum, EpisodeNum, Filename) \ VALUES ("{}", {}, {}, "{}")'.format(file_details['SeriesName'], file_details['SeasonNum'], file_details['EpisodeNums'][0], file_details['FileName'])) file_id = int(self.cursor.lastrowid) except sqlite3.IntegrityError, e: raise DuplicateRecord except sqlite3.Error, e: raise UnexpectedErrorOccured( "File Information Insert: {} {}".format(e, file_details))
class fileParserGroup_1(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) self.library = FileParser() args = self.library.options.parser.parse_args('--error') ''' Test Cases: 01 {Group Name}Covert Affairs ... 02 {Group.Name}Covert.Affairs. ... 03 {Group.Name}Covert_Affairs_ ... 04 {Group Name} Covert Affairs ... 05 {Group.Name}.Covert.Affairs. ... 06 {Group.Name}_Covert_Affairs_ ... 07 [Group Name] Covert Affairs ... 08 [Group.Name].Covert.Affairs. 09 [Group.Name]_Covert_Affairs. 10 [Group Name] - Covert Affairs ... 11 [Group Name].-.Covert.Affairs ... 12 [Group Name]_-_Covert_Affairs ... ''' # 01 {Group Name}Covert Affairs ... def test_fileparser_group_1_011(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 101 Case 011.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_012(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 0101 Case 012.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_013(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 1001 Case 013.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_014(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 01001 Case 014.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 {Group.Name}Covert.Affairs. ... def test_fileparser_group_1_021(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.101 Case 021.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_022(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.0101 Case 022.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_023(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.1001 Case 023.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_024(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.01001 Case 024.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 {Group.Name}Covert_Affairs_ ... def test_fileparser_group_1_031(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_101 Case 031.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_032(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_0101 Case 032.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_033(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_1001 Case 033.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_034(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_01001 Case 034.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 04 {Group Name} Covert Affairs ... def test_fileparser_group_1_041(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 101 Case 041.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_042(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 0101 Case 042.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_043(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 1001 Case 043.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_044(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 01001 Case 044.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 05 {Group.Name}.Covert.Affairs. ... def test_fileparser_group_1_051(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.101 Case 051.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_052(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.0101 Case 052.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_053(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.1001 Case 053.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_054(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.01001 Case 054.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 06 {Group.Name}_Covert_Affairs_ ... def test_fileparser_group_1_061(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_101 Case 061.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_062(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_0101 Case 062.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_063(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_1001 Case 063.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_064(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_01001 Case 064.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 07 [Group Name] Covert Affairs ... def test_fileparser_group_1_071(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 101 Case 071.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_072(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 0101 Case 072.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_073(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 1001 Case 073.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_074(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 01001 Case 074.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 08 [Group.Name].Covert.Affairs. def test_fileparser_group_1_081(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.101 Case 081.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_082(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.0101 Case 082.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_083(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.1001 Case 083.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_084(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.01001 Case 084.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 09 [Group.Name]_Covert_Affairs. def test_fileparser_group_1_091(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_101 Case 091.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_092(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_0101 Case 092.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_093(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_1001 Case 093.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_094(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_01001 Case 094.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 10 [Group Name] - Covert Affairs ... def test_fileparser_group_1_101(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 101 Case 101.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_102(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 0101 Case 102.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_103(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 1001 Case 103.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_104(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 01001 Case 104.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 11 [Group Name].-.Covert.Affairs ... def test_fileparser_group_1_111(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.101 Case 111.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_112(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.0101 Case 112.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_113(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.1001 Case 113.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_114(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.01001 Case 114.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 12 [Group Name]_-_Covert_Affairs ... def test_fileparser_group_1_121(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_101 Case 121.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_122(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_0101 Case 122.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_123(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_1001 Case 0123.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_124(self): KnownValues.File_SxxExx["FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_01001 Case 124.mkv" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 Covert Affairs 2012... 02 Covert.Affairs.2012 ... 03 Covert_Affairs_2012 ... ''' # 01 Covert Affairs 2012 ... def test_FileParser_single_case_001(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 2012 S1E01 Case 001.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_002(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 2012 S01E01 Case 002.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_003(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 2012 S1E001 Case 003.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_004(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 2012 S01E001 Case 004.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 Covert.Affairs.2012 ... def test_FileParser_single_case_011(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.2012.S1E01.Case.014.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_012(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.2012.S01E01.Case.015.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_013(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.2012.S1E001.Case.016.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_014(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.2012.S01E001.Case.017.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 Covert_Affairs_2012 ... def test_FileParser_single_case_021(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_2012_S1E01_Case_018.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_022(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_2012_S01E01_Case_019.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_023(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_2012_S1E001_Case_020.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_024(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name]_Covert_Affairs_2012_S01E001_Case_021.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
pp = pprint.PrettyPrinter(indent=1, depth=1) print '-' * 60 pp.pprint(answer) print '-' * 60 if __name__ == "__main__": logger.initialize() log.trace("MAIN: -------------------------------------------------") from series import FileParser import pprint library = SeriesInfo() parser = FileParser() __main__group = library.options.parser.add_argument_group( "Get SeriesInfo Information Options", description=None) __main__group.add_argument("--Error-Log", dest="errorlog", action="store_true", default=False, help="Create Seperate Log for Errors") Library.args = library.options.parser.parse_args(sys.argv[1:]) log.debug("Parsed command line: {!s}".format(library.args)) log_level = logging.getLevelName(library.args.loglevel.upper()) if library.args.logfile == 'daddyvision.log':
class FileParserMultiEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) # logger.start(level=ERROR) self.library = FileParser() # Multi-Episode S##E##E## def test_FileParser_multi_case_000(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Series/DadVision/Covert Affairs/Season 1/E01-E02 Case 000.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_001(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E01e02 Case 001.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_002(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E01e02 Case 002.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_003(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E001e002 Case 003.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_004(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E001e002 Case 004.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode S##E##-E## def test_FileParser_multi_case_005(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E01-e02 Case 005.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_006(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E01-e02 Case 006.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_007(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E001-e002 Case 007.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_008(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E001-e002 Case 008.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode S##E##-## def test_FileParser_multi_case_009(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E01-02 Case 009.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_010(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E01-02 Case 010.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_011(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E001-002 Case 011.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_012(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E001-002 Case 012.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode S##E## S##E## def test_FileParser_multi_case_013(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E01 s1e02 Case 013.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_014(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E01 s01e02 Case 014.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_015(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E001 s1e002 Case 015.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_016(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E001 s01e002 Case 016.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode ##x##x## def test_FileParser_multi_case_017(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x01x02 Case 017.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_018(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x01x02 Case 018.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_019(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x001x002 Case 019.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_020(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x001x002 Case 020.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode ##x##-x## def test_FileParser_multi_case_021(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x01-x02 Case 021.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_022(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x01-x02 Case 022.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_023(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x001-x002 Case 023.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_024(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x001-x002 Case 024.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode ##x##-## def test_FileParser_multi_case_025(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x01-02 Case 025.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_026(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x01-02 Case 026.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_027(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x001-002 Case 027.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_028(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x001-002 Case 028.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode ##x## ##x## def test_FileParser_multi_case_029(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x01 1x02 Case 029.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_030(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x01 01x02 Case 030.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_031(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1x001 1x002 Case 031.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_032(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01x001 01x002 Case 032.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode ####-## def test_FileParser_multi_case_033(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 101-02 Case 033.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_multi_case_034(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 0101-02 Case 034.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_035(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1001-002 Case 035.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_036(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01001-002 Case 036.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode #### #### @unittest.expectedFailure def test_FileParser_multi_case_037(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 101 102 Case 037.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_038(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 0101 0102 Case 038.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_039(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 1001 1002 Case 039.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_040(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs 01001 01002 Case 040.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode [####-##] @unittest.expectedFailure def test_FileParser_multi_case_041(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [101-02] Case 041.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_042(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [0101-02] Case 042.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_043(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [1001-002] Case 043.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_044(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [01001-002] Case 044.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # Multi-Episode [#### ####] @unittest.expectedFailure def test_FileParser_multi_case_045(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [101] [102] Case 045.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_046(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [0101] [0102] Case 046.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_047(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [1001] [1002] Case 047.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_FileParser_multi_case_048(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/Covert Affairs [01001] [01002] Case 048.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class fileParserGroup_5(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 {Group Name}Covert Affairs 2012 ... 02 {Group.Name}Covert.Affairs.2012. ... 03 {Group.Name}Covert_Affairs_2012_ ... 04 {Group Name} Covert Affairs 2012 ... 05 {Group.Name}.Covert.Affairs.2012. ... 06 {Group.Name}_Covert_Affairs_2012_ ... 07 [Group Name] Covert Affairs 2012 ... 08 [Group.Name].Covert.Affairs.2012. 09 [Group.Name]_Covert_Affairs_2012. 10 [Group Name] - Covert Affairs 2012 ... 11 [Group Name].-.Covert.Affairs.2012 ... 12 [Group Name]_-_Covert_Affairs_2012 ... ''' # 01 {Group Name}Covert Affairs 2012 ... def test_fileparser_group_5_011(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 S1E01 Case 011.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_012(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 S01E01 Case 012.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_013(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 S1E001 Case 013.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_014(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 S01E001 Case 014.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 {Group.Name}Covert.Affairs.2012. ... def test_fileparser_group_5_021(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.S1E01 Case 021.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_022(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.S01E01 Case 022.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_023(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.S1E001 Case 023.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_024(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.S01E001 Case 024.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 {Group.Name}Covert_Affairs_2012_ ... def test_fileparser_group_5_031(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_S1E01 Case 031.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_032(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_S01E01 Case 032.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_033(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_S1E001 Case 033.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_034(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_S01E001 Case 034.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 04 {Group Name} Covert Affairs 2012 ... def test_fileparser_group_5_041(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 S1E01 Case 041.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_042(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 S01E01 Case 042.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_043(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 S1E001 Case 043.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_044(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 S01E001 Case 044.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 05 {Group.Name}.Covert.Affairs.2012. ... def test_fileparser_group_5_051(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.S1E01 Case 051.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_052(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.S01E01 Case 052.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_053(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.S1E001 Case 053.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_054(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.S01E001 Case 054.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 06 {Group.Name}_Covert_Affairs_2012_ ... def test_fileparser_group_5_061(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_S1E01 Case 061.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_062(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_S01E01 Case 062.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_063(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_S1E001 Case 063.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_064(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_S01E001 Case 064.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 07 [Group Name] Covert Affairs 2012 ... def test_fileparser_group_5_071(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 S1E01 Case 071.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_072(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 S01E01 Case 072.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_073(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 S1E001 Case 073.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_074(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 S01E001 Case 074.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 08 [Group.Name].Covert.Affairs.2012. def test_fileparser_group_5_081(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.S1E01 Case 081.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_082(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.S01E01 Case 082.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_083(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.S1E001 Case 083.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_084(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.S01E001 Case 084.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 09 [Group.Name]_Covert_Affairs_2012. def test_fileparser_group_5_091(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_S1E01 Case 091.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_092(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_S01E01 Case 092.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_093(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_S1E001 Case 093.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_094(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_S01E001 Case 094.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 10 [Group Name] - Covert Affairs 2012 ... def test_fileparser_group_5_101(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 S1E01 Case 101.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_102(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 S01E01 Case 102.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_103(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 S1E001 Case 103.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_104(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 S01E001 Case 104.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 11 [Group Name].-.Covert.Affairs.2012 ... def test_fileparser_group_5_111(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.S1E01 Case 111.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_112(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.S01E01 Case 112.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_113(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.S1E001 Case 113.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_114(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.S01E001 Case 114.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 12 [Group Name]_-_Covert_Affairs_2012 ... def test_fileparser_group_5_121(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_S1E01 Case 121.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_122(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_S01E01 Case 122.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_123(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_S1E001 Case 0123.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_5_124(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_S01E001 Case 124.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class fileParserGroup_4(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 {Group Name}Covert Affairs 2012 ... 02 {Group.Name}Covert.Affairs.2012. ... 03 {Group.Name}Covert_Affairs_2012_ ... 04 {Group Name} Covert Affairs 2012 ... 05 {Group.Name}.Covert.Affairs.2012. ... 06 {Group.Name}_Covert_Affairs_2012_ ... 07 [Group Name] Covert Affairs 2012 ... 08 [Group.Name].Covert.Affairs.2012. 09 [Group.Name]_Covert_Affairs_2012. 10 [Group Name] - Covert Affairs 2012 ... 11 [Group Name].-.Covert.Affairs.2012 ... 12 [Group Name]_-_Covert_Affairs_2012 ... ''' # 01 {Group Name}Covert Affairs 2012 ... def test_fileparser_group_4_011(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 1x01 Case 011.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_012(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 01x01 Case 012.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_013(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 1x001 Case 013.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_014(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name}Covert Affairs 2012 01x001 Case 014.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 {Group.Name}Covert.Affairs.2012. ... def test_fileparser_group_4_021(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.1x01 Case 021.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_022(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.01x01 Case 022.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_023(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.1x001 Case 023.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_024(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}Covert.Affairs.2012.01x001 Case 024.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 {Group.Name}Covert_Affairs_2012_ ... def test_fileparser_group_4_031(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_1x01 Case 031.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_032(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_01x01 Case 032.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_033(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_1x001 Case 033.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_034(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}Covert_Affairs_2012_01x001 Case 034.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 04 {Group Name} Covert Affairs 2012 ... def test_fileparser_group_4_041(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 1x01 Case 041.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_042(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 01x01 Case 042.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_043(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 1x001 Case 043.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_044(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group Name} Covert Affairs 2012 01x001 Case 044.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 05 {Group.Name}.Covert.Affairs.2012. ... def test_fileparser_group_4_051(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.1x01 Case 051.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_052(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.01x01 Case 052.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_053(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.1x001 Case 053.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_054(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group.Name}.Covert.Affairs.2012.01x001 Case 054.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 06 {Group.Name}_Covert_Affairs_2012_ ... def test_fileparser_group_4_061(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_1x01 Case 061.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_062(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_01x01 Case 062.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_063(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_1x001 Case 063.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_064(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/{Group_Name}_Covert_Affairs_2012_01x001 Case 064.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 07 [Group Name] Covert Affairs 2012 ... def test_fileparser_group_4_071(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 1x01 Case 071.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_072(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 01x01 Case 072.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_073(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 1x001 Case 073.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_074(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] Covert Affairs 2012 01x001 Case 074.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 08 [Group.Name].Covert.Affairs.2012. def test_fileparser_group_4_081(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.1x01 Case 081.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_082(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.01x01 Case 082.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_083(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.1x001 Case 083.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_084(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].Covert.Affairs.2012.01x001 Case 084.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 09 [Group.Name]_Covert_Affairs_2012. def test_fileparser_group_4_091(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_1x01 Case 091.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_092(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_01x01 Case 092.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_093(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_1x001 Case 093.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_094(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_Covert_Affairs_2012_01x001 Case 094.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 10 [Group Name] - Covert Affairs 2012 ... def test_fileparser_group_4_101(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 1x01 Case 101.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_102(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 01x01 Case 102.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_103(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 1x001 Case 103.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_104(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group Name] - Covert Affairs 2012 01x001 Case 104.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 11 [Group Name].-.Covert.Affairs.2012 ... def test_fileparser_group_4_111(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.1x01 Case 111.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_112(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.01x01 Case 112.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_113(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.1x001 Case 113.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_114(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group.Name].-.Covert.Affairs.2012.01x001 Case 114.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 12 [Group Name]_-_Covert_Affairs_2012 ... def test_fileparser_group_4_121(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_1x01 Case 121.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_122(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_01x01 Case 122.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_123(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_1x001 Case 0123.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_4_124(self): KnownValues.File_SxxExx["FileName"] = "/mnt/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_2012_01x001 Case 124.ext" self.assertEqual(self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 Covert Affairs ... 02 Covert.Affairs. ... 03 Covert_Affairs_ ... ''' # 01 Covert Affairs ... def test_FileParser_single_case_011(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 1 Episode 01 Case 011.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_012(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 01 Episode 01 Case 012.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_013(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 1 Episode 001 Case 013.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_014(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs Season 01 Episode 001 Case 014.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 Covert.Affairs. ... def test_FileParser_single_case_021(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.1.Episode.01.Case.021.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_022(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.01.Episode.01.Case.022.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_023(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.1.Episode.001.Case.023.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_024(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.Season.01.Episode.001.Case.024.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 Covert_Affairs_ ... def test_FileParser_single_case_031(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_1_Episode_01_Case_031.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_032(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_01_Episode_01_Case_032.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_033(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_1_Episode_001_Case_033.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_034(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_Season_01_Episode_001_Case_034.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
__copyright__ = "Copyright 2011, AJ Reynolds" __license__ = "GPL" TRACE = 5 VERBOSE = 15 log = logging.getLogger(__pgmname__) logger.initialize() TRACE = 5 VERBOSE = 15 config = Settings() fileparser = FileParser() db = sqlite3.connect(config.DBFile) cursor = db.cursor() def load_entry(user, file_name): t = os.path.getmtime(file_name) timestamp = datetime.datetime.fromtimestamp(t) try: file_details = fileparser.getFileDetails(file_name) # SQL # cursor.execute( 'INSERT INTO Downloads(Name, SeriesName, Filename, DownloadTimeStamp) VALUES ("{}", "{}", "{}", "{}")'
class fileParserGroup_1(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=INFO) self.library = FileParser() args = self.library.options.parser.parse_args('--error') ''' Test Cases: 01 {Group Name}Covert Affairs ... 02 {Group.Name}Covert.Affairs. ... 03 {Group.Name}Covert_Affairs_ ... 04 {Group Name} Covert Affairs ... 05 {Group.Name}.Covert.Affairs. ... 06 {Group.Name}_Covert_Affairs_ ... 07 [Group Name] Covert Affairs ... 08 [Group.Name].Covert.Affairs. 09 [Group.Name]_Covert_Affairs. 10 [Group Name] - Covert Affairs ... 11 [Group Name].-.Covert.Affairs ... 12 [Group Name]_-_Covert_Affairs ... ''' # 01 {Group Name}Covert Affairs ... def test_fileparser_group_1_011(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 101 Case 011.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_012(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 0101 Case 012.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_013(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 1001 Case 013.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_014(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name}Covert Affairs 01001 Case 014.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 {Group.Name}Covert.Affairs. ... def test_fileparser_group_1_021(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.101 Case 021.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_022(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.0101 Case 022.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_023(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.1001 Case 023.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_024(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}Covert.Affairs.01001 Case 024.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 {Group.Name}Covert_Affairs_ ... def test_fileparser_group_1_031(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_101 Case 031.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_032(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_0101 Case 032.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_033(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_1001 Case 033.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_034(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}Covert_Affairs_01001 Case 034.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 04 {Group Name} Covert Affairs ... def test_fileparser_group_1_041(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 101 Case 041.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_042(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 0101 Case 042.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_043(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 1001 Case 043.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_044(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group Name} Covert Affairs 01001 Case 044.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 05 {Group.Name}.Covert.Affairs. ... def test_fileparser_group_1_051(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.101 Case 051.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_052(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.0101 Case 052.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_053(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.1001 Case 053.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_054(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group.Name}.Covert.Affairs.01001 Case 054.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 06 {Group.Name}_Covert_Affairs_ ... def test_fileparser_group_1_061(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_101 Case 061.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_062(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_0101 Case 062.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_063(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_1001 Case 063.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_064(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/{Group_Name}_Covert_Affairs_01001 Case 064.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 07 [Group Name] Covert Affairs ... def test_fileparser_group_1_071(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 101 Case 071.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_072(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 0101 Case 072.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_073(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 1001 Case 073.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_074(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] Covert Affairs 01001 Case 074.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 08 [Group.Name].Covert.Affairs. def test_fileparser_group_1_081(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.101 Case 081.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_082(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.0101 Case 082.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_083(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.1001 Case 083.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_084(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].Covert.Affairs.01001 Case 084.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 09 [Group.Name]_Covert_Affairs. def test_fileparser_group_1_091(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_101 Case 091.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_092(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_0101 Case 092.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_093(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_1001 Case 093.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_094(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_Covert_Affairs_01001 Case 094.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 10 [Group Name] - Covert Affairs ... def test_fileparser_group_1_101(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 101 Case 101.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_102(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 0101 Case 102.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_103(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 1001 Case 103.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_104(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group Name] - Covert Affairs 01001 Case 104.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 11 [Group Name].-.Covert.Affairs ... def test_fileparser_group_1_111(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.101 Case 111.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_112(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.0101 Case 112.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_113(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.1001 Case 113.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_114(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group.Name].-.Covert.Affairs.01001 Case 114.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 12 [Group Name]_-_Covert_Affairs ... def test_fileparser_group_1_121(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_101 Case 121.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_fileparser_group_1_122(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_0101 Case 122.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_123(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_1001 Case 0123.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) @unittest.expectedFailure def test_fileparser_group_1_124(self): KnownValues.File_SxxExx[ "FileName"] = "/srv/Download/Bittorrent/[Group_Name]_-_Covert_Affairs_01001 Case 124.mkv" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite
class FileParserSingleEps(unittest.TestCase): def setUp(self): TRACE = 5 VERBOSE = 15 logger.initialize(unit_test=True, level=VERBOSE) # logger.start(level=ERROR) self.library = FileParser() ''' Test Cases: 01 Covert Affairs ... 02 Covert.Affairs. ... 03 Covert_Affairs_ ... ''' # 01 Covert Affairs ... def test_FileParser_single_case_001(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E01 Case 006.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_002(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E01 Case 007.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_003(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S1E001 Case 008.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_004(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert Affairs S01E001 Case 009.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 02 Covert.Affairs. ... def test_FileParser_single_case_021(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.S1E01.Title.ext Case 026.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_022(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.S01E01.Title.ext Case 027.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_023(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.S1E001.Title.ext Case 028.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_024(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert.Affairs.S01E001.Title.ext Case 029.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) # 03 Covert_Affairs_ ... def test_FileParser_single_case_031(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_S1E01_Title.ext Case 046.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_032(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_S01E01_Title.ext Case 047.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_033(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_S1E001_Title.ext Case 048.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def test_FileParser_single_case_034(self): KnownValues.File_SxxExx[ "FileName"] = "/mnt/Download/Bittorrent/Covert_Affairs_S01E001_Title.ext Case 049.ext" self.assertEqual( self.library.getFileDetails(KnownValues.File_SxxExx["FileName"]), KnownValues.File_SxxExx) def theSuite(self): suite = unittest.TestLoader().loadTestsFromTestCase(self) return suite