예제 #1
0
    def setUp(self):
        super(PPPrivateTests, self).setUp()

        sickbeard.showList = [TVShow(1,0000), TVShow(1,0001)]

        self.pp = PostProcessor(test.FILEPATH)
        self.show_obj = TVShow(1,0002)

        self.db = test.db.DBConnection()
        newValueDict = {"indexerid": 1002,
                        "name": test.SHOWNAME,
                        "description": "description",
                        "airdate": 1234,
                        "hasnfo": 1,
                        "hastbn": 1,
                        "status": 404,
                        "location": test.FILEPATH}
        controlValueDict = {"showid": 0002,
                            "season": test.SEASON,
                            "episode": test.EPISODE}

        # use a custom update/insert method to get the data into the DB
        self.db.upsert("tv_episodes", newValueDict, controlValueDict)

        self.ep_obj = TVEpisode(self.show_obj, test.SEASON, test.EPISODE, test.FILEPATH)
        print
예제 #2
0
    def test_process(self):
        show = TVShow(1, 3)
        show.name = test.SHOWNAME
        show.location = test.SHOWDIR
        show.saveToDB()

        sickbeard.showList = [show]
        ep = TVEpisode(show, test.SEASON, test.EPISODE)
        ep.name = "some ep name"
        ep.saveToDB()

        pp = PostProcessor(test.FILEPATH)
        self.assertTrue(pp.process())
예제 #3
0
    def test_process(self):
        show = TVShow(1, 3)
        show.name = test.SHOWNAME
        show.location = test.SHOWDIR
        show.saveToDB()

        sickbeard.showList = [show]
        ep = TVEpisode(show, test.SEASON, test.EPISODE)
        ep.name = "some ep name"
        ep.saveToDB()

        addNameToCache('show name', 3)
        self.pp = PostProcessor(test.FILEPATH, process_method='move')
        self.assertTrue(self.pp.process())
예제 #4
0
파일: pp_tests.py 프로젝트: v0re/SickGear
    def test_process(self):
        show_obj = TVShow(1, 3)
        show_obj.tvid = TVINFO_TVDB
        show_obj.name = test.SHOWNAME
        show_obj.location = test.SHOWDIR
        show_obj.save_to_db()

        sickbeard.showList = [show_obj]
        ep_obj = TVEpisode(show_obj, test.SEASON, test.EPISODE)
        ep_obj.name = 'some ep name'
        ep_obj.release_name = 'test setter'
        ep_obj.save_to_db()

        addNameToCache('show name', tvid=TVINFO_TVDB, prodid=3)
        sickbeard.PROCESS_METHOD = 'move'

        pp = PostProcessor(test.FILEPATH)
        self.assertTrue(pp.process())
예제 #5
0
    def __init__(self, test_case):
        super(ListAssociatedFiles, self).__init__(test_case)
        self.test_tree = os.path.join('Show Name', 'associated_files', 'random', 'recursive', 'subdir')

        file_names = [
            'Show Name [SickChill].avi',
            'Show Name [SickChill].srt',
            'Show Name [SickChill].nfo',
            'Show Name [SickChill].en.srt',
            'Non-Associated Show [SickChill].srt',
            'Non-Associated Show [SickChill].en.srt',
            'Show [SickChill] Non-Associated.en.srt',
            'Show [SickChill] Non-Associated.srt',
        ]
        self.file_list = [os.path.join('Show Name', f) for f in file_names] + [os.path.join(self.test_tree, f) for f in file_names]
        self.post_processor = PostProcessor('Show Name')
        self.maxDiff = None
        sickbeard.MOVE_ASSOCIATED_FILES = True
        sickbeard.ALLOWED_EXTENSIONS = ''
예제 #6
0
    def test_process(self):
        """
        Test process
        """
        show = TVShow(1, 3)
        show.name = test.SHOW_NAME
        show.location = test.SHOW_DIR
        show.saveToDB()

        sickbeard.showList = [show]
        episode = TVEpisode(show, test.SEASON, test.EPISODE)
        episode.name = "some episode name"
        episode.saveToDB()

        addNameToCache('show name', 3)
        sickbeard.PROCESS_METHOD = 'move'

        post_processor = PostProcessor(test.FILE_PATH)
        self.assertTrue(post_processor.process())
예제 #7
0
    def __init__(self, test_case):
        super(ListAssociatedFiles, self).__init__(test_case)
        self.test_tree = os.path.join(u'Show Name', u'associated_files',
                                      u'random', u'recursive', u'subdir')

        file_names = [
            u'Show Name [SickRage].avi',
            u'Show Name [SickRage].srt',
            u'Show Name [SickRage].nfo',
            u'Show Name [SickRage].en.srt',
            u'Non-Associated Show [SickRage].srt',
            u'Non-Associated Show [SickRage].en.srt',
            u'Show [SickRage] Non-Associated.en.srt',
            u'Show [SickRage] Non-Associated.srt',
        ]
        self.file_list = [
            os.path.join(u'Show Name', f) for f in file_names
        ] + [os.path.join(self.test_tree, f) for f in file_names]
        self.post_processor = PostProcessor(u'Show Name')
        self.maxDiff = None
예제 #8
0
    def test(self):

        self.showDir = test_lib.setUp_test_show_dir(show_name)
        self.filePath = test_lib.setUp_test_episode_file(
            None, curData["b"] + ".mkv")

        show = TVShow(tvdbdid)
        show.name = show_name
        show.quality = curData["q"]
        show.location = self.showDir
        if curData["anime"]:
            show.anime = 1
        show.saveToDB()
        sickbeard.showList.append(show)

        for epNumber in curData["e"]:
            episode = TVEpisode(show, curData["s"], epNumber)
            episode.status = c.WANTED
            if "ab" in curData:
                episode.absolute_number = curData["ab"]
            episode.saveToDB()

        pp = PostProcessor(self.filePath)
        self.assertTrue(pp.process())
예제 #9
0
 def setUp(self):
     self.pp = PostProcessor(test.FILEPATH)
예제 #10
0
 def setUp(self):
     """
     Set up tests
     """
     self.post_processor = PostProcessor(test.FILE_PATH)
예제 #11
0
 def setUp(self):
     super(PPInitTests, self).setUp()
     self.pp = PostProcessor(test.FILEPATH)
예제 #12
0
 def setUp(self, **kwargs):
     super(PPInitTests, self).setUp()
     self.pp = PostProcessor(FILEPATH)