Esempio n. 1
0
 def test_scene_date_fmt_filenames(self):
     """
     Test scene date format file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'scene_date_format',
                      lambda x: x + '.avi')
Esempio n. 2
0
    def _test_combo(self, name, result, which_regexes):
        """
        Perform combination test

        :param name:
        :param result:
        :param which_regexes:
        :return:
        """

        if VERBOSE:
            print()
            print("Testing", name)

        name_parser = parser.NameParser(True)

        try:
            test_result = name_parser.parse(name)
        except parser.InvalidShowException:
            return False

        if DEBUG:
            print(test_result, test_result.which_regex)
            print(result, which_regexes)

        assert str(test_result) == str(result)
        for cur_regex in which_regexes:
            assert cur_regex in test_result.which_regex
        assert len(which_regexes) == len(test_result.which_regex)
Esempio n. 3
0
 def test_no_s_general_filenames(self):
     """
     Test no season general file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'no_season_general',
                      lambda x: x + '.avi')
Esempio n. 4
0
    def _test_combo(self, name, result, which_regexes):
        """
        Perform combination test

        :param name:
        :param result:
        :param which_regexes:
        :return:
        """

        if VERBOSE:
            print()
            print('Testing', name)

        name_parser = parser.NameParser(True)

        try:
            test_result = name_parser.parse(name)
        except parser.InvalidShowException:
            return False

        if DEBUG:
            print(test_result, test_result.which_regex)
            print(result, which_regexes)

        self.assertEqual(str(test_result), str(result))
        for cur_regex in which_regexes:
            self.assertTrue(cur_regex in test_result.which_regex)
        self.assertEqual(len(which_regexes), len(test_result.which_regex))
Esempio n. 5
0
 def test_no_s_multi_ep_filenames(self):
     """
     Test no season multi episode file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'no_season_multi_ep',
                      lambda x: x + '.avi')
Esempio n. 6
0
    def _test_unicode(self, name, result):
        """
        Test str

        :param name:
        :param result:
        :return:
        """
        name_parser = parser.NameParser(True, showObj=self.show)
        parse_result = name_parser.parse(name)

        # this shouldn't raise an exception
        repr(str(parse_result))
        self.assertEqual(parse_result.extra_info, result.extra_info)
Esempio n. 7
0
    def _test_name(name):
        """
        Test name

        :param name:
        :return:
        """
        name_parser = parser.NameParser(True)
        try:
            parse_result = name_parser.parse(name)
        except (parser.InvalidNameException, parser.InvalidShowException):
            return True

        if VERBOSE:
            print('Actual: ', parse_result.which_regex, parse_result)
        return False
Esempio n. 8
0
 def test_bare_filenames(self):
     """
     Test bare file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, "bare", lambda x: x + ".avi")
Esempio n. 9
0
 def test_scene_date_fmt_names(self):
     """
     Test scene date format names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'scene_date_format')
Esempio n. 10
0
 def test_bare_names(self):
     """
     Test bare names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'bare')
Esempio n. 11
0
 def test_anime_bare_filenames_indirect(self):
     """
     Test anime bare file names without defining parse method
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'anime_bare', lambda x: x + '.avi')
Esempio n. 12
0
 def test_anime_sxxexx_filenames(self):
     """
     Test anime SxxExx file names
     """
     name_parser = parser.NameParser(parse_method='anime')
     self._test_names(name_parser, 'anime_SxxExx', lambda x: x + '.avi')
Esempio n. 13
0
 def test_s_only_names(self):
     """
     Test season only names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'season_only')
Esempio n. 14
0
 def test_standard_repeat_filenames(self):
     """
     Test standard repeat file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'standard_repeat', lambda x: x + '.avi')
Esempio n. 15
0
 def test_standard_repeat_names(self):
     """
     Test standard repeat names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'standard_repeat')
Esempio n. 16
0
 def test_standard_names(self):
     """
     Test standard names
     """
     name_parser = parser.NameParser(True)
     self._test_names(name_parser, 'standard')
Esempio n. 17
0
 def test_no_s_file_names(self):
     """
     Test no season file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'no_season', lambda x: x + '.avi')
Esempio n. 18
0
 def test_no_s_multi_ep_names(self):
     """
     Test no season multi episode names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'no_season_multi_ep')
Esempio n. 19
0
 def test_fov_names(self):
     """
     Test fov names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'fov')
Esempio n. 20
0
 def test_fov_repeat_names(self):
     """
     Test fov repeat names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'fov_repeat')
Esempio n. 21
0
 def test_s_only_filenames(self):
     """
     Test season only file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'season_only', lambda x: x + '.avi')
Esempio n. 22
0
 def test_fov_repeat_filenames(self):
     """
     Test fov repeat file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'fov_repeat', lambda x: x + '.avi')
Esempio n. 23
0
 def test_anime_bare_filenames(self):
     """
     Test anime bare file names
     """
     name_parser = parser.NameParser(parse_method='anime')
     self._test_names(name_parser, 'anime_bare', lambda x: x + '.avi')
Esempio n. 24
0
 def test_stupid_names(self):
     """
     Test stupid names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'stupid')
Esempio n. 25
0
 def test_no_s_names(self):
     """
     Test no season names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'no_season')
Esempio n. 26
0
 def test_anime_bare_filenames(self):
     """
     Test anime bare file names
     """
     name_parser = parser.NameParser(parse_method="anime")
     self._test_names(name_parser, "anime_bare", lambda x: x + ".avi")
Esempio n. 27
0
 def test_bare_filenames(self):
     """
     Test bare file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'bare', lambda x: x + '.avi')
Esempio n. 28
0
 def test_no_s_general_names(self):
     """
     Test no season general names
     """
     name_parser = parser.NameParser(False)
     self._test_names(name_parser, 'no_season_general')
Esempio n. 29
0
 def test_stupid_filenames(self):
     """
     Test stupid file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, 'stupid', lambda x: x + '.avi')
Esempio n. 30
0
 def test_no_s_filenames(self):
     """
     Test no season file names
     """
     name_parser = parser.NameParser()
     self._test_names(name_parser, "no_season", lambda x: x + ".avi")