示例#1
0
文件: test.py 项目: rafallo/p2c
class TMDBApiClientTestCase(TestCase):
    def setUp(self):
        self.client = TMDBApiClient()

    def test_search_for_movie(self):
        movies = self.client.search_for_movies("matrix")
        candidate = movies[0]
        self.assertEqual(candidate['title'], "The Matrix")
        self.assertTrue('poster_path' in candidate)

    def test_search_for_movie_fail(self):
        movies = self.client.search_for_movies("this movie does not exist")
        self.assertEqual(len(movies),0)
#
    def test_match_title(self):
        movie = self.client.match_title('American.Hustle')
        self.assertEqual(movie['title'], "American Hustle")

        movie = self.client.match_title('American Hustle (2013) XViD (Screener) DD2.0 Custom NLsubs NLtop')
        self.assertEqual(movie['title'], "American Hustle")
示例#2
0
class TMDBApiClientTestCase(TestCase):
    def setUp(self):
        self.client = TMDBApiClient()

    def test_search_for_movie(self):
        movies = self.client.search_for_movies("matrix")
        candidate = movies[0]
        self.assertEqual(candidate['title'], "The Matrix")
        self.assertTrue('poster_path' in candidate)

    def test_search_for_movie_fail(self):
        movies = self.client.search_for_movies("this movie does not exist")
        self.assertEqual(len(movies), 0)
#

    def test_match_title(self):
        movie = self.client.match_title('American.Hustle')
        self.assertEqual(movie['title'], "American Hustle")

        movie = self.client.match_title(
            'American Hustle (2013) XViD (Screener) DD2.0 Custom NLsubs NLtop')
        self.assertEqual(movie['title'], "American Hustle")
示例#3
0
 def setUp(self):
     self.client = TMDBApiClient()
示例#4
0
# -*- coding: utf-8 -*-
from catalogs.info_clients.tmdbclient import TMDBApiClient

client = TMDBApiClient()

class TorrentInfo(object):
    def __init__(self, slug, label, seeders, leechers, kwargs):
        self.slug = slug
        self.label = label
        self.seeders = seeders
        self.leechers = leechers
        self.kwargs = kwargs

        self.description = None
        self.poster = None
        self.title = None

    def get_magnet(self):
        return self.kwargs['magnet']

    def get_torrent_file(self):
        return self.kwargs['torrent_file']

    def get_availability_rate(self) -> int:
        """
        returns integer which values are described below:
        0 - no chance to download torrent
        1 - little change to smooth movie watching
        2 - probably you can watch it
        3 - perfect chance. A lot of seeds
        """
示例#5
0
文件: test.py 项目: rafallo/p2c
 def setUp(self):
     self.client = TMDBApiClient()