Пример #1
0
    def test_download_but_no_result_from_OpenSubtitles(self):
        """ Tests what happens when there is
        no subtitle from OpenSubtitles. """
        video = Video(self.video2_filename)

        video.languages_to_download = self.babel_languages

        server = OpenSubtitlesServer()
        server.connect()
        response = server.download_subtitles([video], self.babel_languages)
        self.assertFalse(response)
        server.disconnect()
Пример #2
0
    def test_download_but_no_result_from_OpenSubtitles(self):
        """ Tests what happens when there is
        no subtitle from OpenSubtitles. """
        video = Video(self.video2_filename)

        video.languages_to_download = self.babel_languages

        server = OpenSubtitlesServer()
        server.connect()
        response = server.download_subtitles([video], self.babel_languages)
        self.assertFalse(response)
        server.disconnect()
Пример #3
0
    def test_download_from_OpenSubtitles(self):
        """ Tests if it is possible to download
        a subtitle from OpenSubtitles. """
        episode = Video(self.video_filename)
        episode.size = str(243500836)
        episode.languages_to_download = self.babel_languages

        server = OpenSubtitlesServer()
        server.connect()
        response = server.download_subtitles([episode],
                                             self.babel_languages,
                                             mock_hash=self.mock_hashcode)
        self.assertTrue(response)
        self.assertTrue(os.path.exists(self.expected_french_subtitle_filename))
        self.assertTrue(os.path.exists(
            self.expected_english_subtitle_filename))
        server.disconnect()
Пример #4
0
    def test_download_from_OpenSubtitles(self):
        """ Tests if it is possible to download
        a subtitle from OpenSubtitles. """
        episode = Video(self.video_filename)
        episode.size = str(243500836)
        episode.languages_to_download = self.babel_languages

        server = OpenSubtitlesServer()
        server.connect()
        response = server.download_subtitles(
            [episode], self.babel_languages,
            mock_hash=self.mock_hashcode)
        self.assertTrue(response)
        self.assertTrue(os.path.exists(
            self.expected_french_subtitle_filename))
        self.assertTrue(os.path.exists(
            self.expected_english_subtitle_filename))
        server.disconnect()