当前位置: 首页>>代码示例>>Python>>正文


Python lostfilm.LostFilmTVTracker类代码示例

本文整理汇总了Python中monitorrent.plugins.trackers.lostfilm.LostFilmTVTracker的典型用法代码示例。如果您正苦于以下问题:Python LostFilmTVTracker类的具体用法?Python LostFilmTVTracker怎么用?Python LostFilmTVTracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LostFilmTVTracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_login_failed_unknown_2

    def test_login_failed_unknown_2(self):
        mock_tracker = LostFilmTVTracker()
        login_mock = Mock(side_effect=Exception)
        mock_tracker.login = login_mock
        self.plugin.tracker = mock_tracker
        self.plugin.update_credentials({'username': 'monitorrent', 'password': 'monitorrent'})
        self.assertEqual(self.plugin.login(), LoginResult.Unknown)

        login_mock.assert_called_with('monitorrent', 'monitorrent')
开发者ID:werwolfby,项目名称:monitorrent,代码行数:9,代码来源:test_lostfilmtrackerplugin.py

示例2: test_login_failed_incorrect_login_password

    def test_login_failed_incorrect_login_password(self):
        mock_tracker = LostFilmTVTracker()
        mock_tracker.tracker_settings = self.tracker_settings
        login_mock = Mock(side_effect=LostFilmTVLoginFailedException(6, 'incorrect login/password', ''))
        mock_tracker.login = login_mock
        self.plugin.tracker = mock_tracker
        self.plugin.update_credentials({'username': 'monitorrent', 'password': 'monitorrent'})
        self.assertEqual(self.plugin.login(), LoginResult.IncorrentLoginPassword)

        login_mock.assert_called_with('monitorrent', 'monitorrent')
开发者ID:werwolfby,项目名称:monitorrent,代码行数:10,代码来源:test_lostfilmtrackerplugin.py

示例3: test_login_failed_unknown_1

    def test_login_failed_unknown_1(self):
        mock_tracker = LostFilmTVTracker()
        mock_tracker.tracker_settings = self.tracker_settings
        login_mock = Mock(side_effect=LostFilmTVLoginFailedException(1, 'temp_code', 'temp_message'))
        mock_tracker.login = login_mock
        self.plugin.tracker = mock_tracker
        self.plugin.update_credentials({'username': 'monitorrent', 'password': 'monitorrent'})
        self.assertEqual(self.plugin.login(), LoginResult.Unknown)

        login_mock.assert_called_with('monitorrent', 'monitorrent')
开发者ID:werwolfby,项目名称:monitorrent,代码行数:10,代码来源:test_lostfilmtrackerplugin.py

示例4: test_download_info

    def test_download_info(self):
        url = 'http://www.lostfilm.tv/browse.php?cat=160'
        tracker = LostFilmTVTracker(helper.real_uid, helper.real_pass, helper.real_usess)
        tracker.tracker_settings = self.tracker_settings
        downloads = tracker.get_download_info(url, 4, 22)

        self.assertEqual(3, len(downloads))
        if PY3:
            # Python 3.4+
            self.assertCountEqual(['SD', '720p', '1080p'], [d['quality'] for d in downloads])
        else:
            # Python 2.7
            self.assertItemsEqual(['SD', '720p', '1080p'], [d['quality'] for d in downloads])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:13,代码来源:test_lostfilmtracker.py

示例5: test_download_info_2

    def test_download_info_2(self):
        url = 'http://www.lostfilm.tv/browse.php?cat=37'
        tracker = LostFilmTVTracker(helper.real_uid, helper.real_pass, helper.real_usess)
        tracker.tracker_settings = self.tracker_settings
        downloads_4_9 = tracker.get_download_info(url, 4, 9)

        self.assertEqual(1, len(downloads_4_9))
        self.assertEqual('SD', downloads_4_9[0]['quality'])

        downloads_4_10 = tracker.get_download_info(url, 4, 10)

        self.assertEqual(2, len(downloads_4_10))
        if PY3:
            self.assertCountEqual(['SD', '720p'], [d['quality'] for d in downloads_4_10])
        else:
            self.assertItemsEqual(['SD', '720p'], [d['quality'] for d in downloads_4_10])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:16,代码来源:test_lostfilmtracker.py

示例6: test_parse_special_rss_title4

 def test_parse_special_rss_title4(self):
     t1 = u'Люди (Humans). Эпизод 8 [WEBRip]. (S01E08)'
     parsed = LostFilmTVTracker.parse_rss_title(t1)
     self.assertEqual(u'Люди', parsed['name'])
     self.assertEqual(u'Humans', parsed['original_name'])
     self.assertEqual(u'Эпизод 8', parsed['title'])
     self.assertIsNone(parsed['original_title'])
     self.assertEqual(u'unknown', parsed['quality'])
     self.assertEqual(u'S01E08', parsed['episode_info'])
     self.assertEqual(1, parsed['season'])
     self.assertEqual(8, parsed['episode'])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:11,代码来源:test_lostfilmtracker.py

示例7: test_parse_special_rss_title

 def test_parse_special_rss_title(self):
     t1 = u'Под куполом (Under the Dome). Идите дальше/А я останусь (Move On/But I\'m Not) [1080p]. (S03E01E02)'
     parsed = LostFilmTVTracker.parse_rss_title(t1)
     self.assertEqual(u'Под куполом', parsed['name'])
     self.assertEqual(u'Under the Dome', parsed['original_name'])
     self.assertEqual(u'Идите дальше/А я останусь', parsed['title'])
     self.assertEqual(u'Move On/But I\'m Not', parsed['original_title'])
     self.assertEqual(u'1080p', parsed['quality'])
     self.assertEqual(u'S03E01E02', parsed['episode_info'])
     self.assertEqual(3, parsed['season'])
     self.assertEqual(2, parsed['episode'])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:11,代码来源:test_lostfilmtracker.py

示例8: test_parse_corrent_rss_title1

 def test_parse_corrent_rss_title1(self):
     t1 = u'Мистер Робот (Mr. Robot). уя3вим0сти.wmv (3xpl0its.wmv). (S01E05)'
     parsed = LostFilmTVTracker.parse_rss_title(t1)
     self.assertEqual(u'Мистер Робот', parsed['name'])
     self.assertEqual(u'Mr. Robot', parsed['original_name'])
     self.assertEqual(u'уя3вим0сти.wmv', parsed['title'])
     self.assertEqual(u'3xpl0its.wmv', parsed['original_title'])
     self.assertEqual(u'SD', parsed['quality'])
     self.assertEqual(u'S01E05', parsed['episode_info'])
     self.assertEqual(1, parsed['season'])
     self.assertEqual(5, parsed['episode'])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:11,代码来源:test_lostfilmtracker.py

示例9: test_login_success

    def test_login_success(self):
        mock_tracker = LostFilmTVTracker()
        mock_tracker.tracker_settings = self.tracker_settings
        mock_tracker.c_uid = '123456'
        mock_tracker.c_pass = 'c3cdf2d2784e81097cda167b8f0674bd'
        mock_tracker.c_uid = 'e9853fcd82cd46a5294349151700643e'
        login_mock = Mock()
        mock_tracker.login = login_mock
        self.plugin.tracker = mock_tracker
        self.plugin.update_credentials({'username': 'monitorrent', 'password': 'monitorrent'})
        self.assertEqual(self.plugin.login(), LoginResult.Ok)

        login_mock.assert_called_with('monitorrent', 'monitorrent')
开发者ID:werwolfby,项目名称:monitorrent,代码行数:13,代码来源:test_lostfilmtrackerplugin.py

示例10: test_parse_correct_title_strange

 def test_parse_correct_title_strange(self):
     title = LostFilmTVTracker._parse_title(u'Род человеческий')
     self.assertEqual(u'Род человеческий', title['original_name'])
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:3,代码来源:test_lostfilmtracker.py

示例11: test_verify_fail

 def test_verify_fail(self):
     tracker = LostFilmTVTracker("457686", '1'*32, '2'*32)
     tracker.tracker_settings = self.tracker_settings
     self.assertFalse(tracker.verify())
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:4,代码来源:test_lostfilmtracker.py

示例12: test_verify

 def test_verify(self):
     tracker = LostFilmTVTracker(helper.real_uid, helper.real_pass, helper.real_usess)
     tracker.tracker_settings = self.tracker_settings
     self.assertTrue(tracker.verify())
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:4,代码来源:test_lostfilmtracker.py

示例13: test_parse_incorrent_rss_title1

 def test_parse_incorrent_rss_title1(self, title):
     self.assertIsNone(LostFilmTVTracker.parse_rss_title(title))
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:2,代码来源:test_lostfilmtracker.py

示例14: setUp

 def setUp(self):
     self.tracker_settings = TrackerSettings(10)
     self.tracker = LostFilmTVTracker()
     self.tracker.tracker_settings = self.tracker_settings
     super(LostFilmTrackerTest, self).setUp()
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:5,代码来源:test_lostfilmtracker.py

示例15: test_download_info_3

 def test_download_info_3(self):
     url = 'http://www.lostfilm.tv/browse_wrong.php?cat=2'
     tracker = LostFilmTVTracker(helper.real_uid, helper.real_pass, helper.real_usess)
     tracker.tracker_settings = self.tracker_settings
     self.assertIsNone(tracker.get_download_info(url, 4, 9))
开发者ID:Avatarchik,项目名称:monitorrent,代码行数:5,代码来源:test_lostfilmtracker.py


注:本文中的monitorrent.plugins.trackers.lostfilm.LostFilmTVTracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。