Beispiel #1
0
    def test_empty_filelist(self):
        filelist = []
        episodes = []
        expected = []

        result = lib.filter_existing(filelist, episodes)
        self.assertEquals(result, expected)
Beispiel #2
0
    def test_one_file_no_episodes(self):
        filelist = [
            "[HorribleSubs] Màgî - 04 [1080p].mkv"
        ]
        episodes = []
        expected = []

        result = lib.filter_existing(filelist, episodes)
        self.assertEquals(result, expected)
Beispiel #3
0
    def test_filename_with_underscores(self):
        filelist = [
            "[HorribleSubs]_Màgî_-_04_[1080p].mkv"
        ]
        episodes = [
            {'filename': "[HorribleSubs] Màgî - 04 [1080p].mkv"}
        ]
        expected = episodes

        result = lib.filter_existing(filelist, episodes)
        self.assertEquals(result, expected)
Beispiel #4
0
    def test_random_files_in_filelist(self):
        filelist = [
            "[HorribleSubs]_Màgî_-_04_[1080p].mkv",
            "file1.txt",
            "file2.txt",
        ]
        episodes = [
            {'filename': "[HorribleSubs] Màgî - 04 [1080p].mkv"}
        ]
        expected = episodes

        result = lib.filter_existing(filelist, episodes)
        self.assertEquals(result, expected)
Beispiel #5
0
    def test_two_episodes_one_file(self):
        filelist = [
            "[HorribleSubs]_Màgî_-_04_[1080p].mkv"
        ]
        episodes = [
            {'filename': "[HorribleSubs] Màgî - 04 [1080p].mkv"},
            {'filename': "[HorribleSubs] Màgî - 05 [1080p].mkv"},
        ]
        expected = [
            {'filename': "[HorribleSubs] Màgî - 04 [1080p].mkv"},
        ]

        result = lib.filter_existing(filelist, episodes)
        self.assertEquals(result, expected)