當前位置: 首頁>>代碼示例>>Python>>正文


Python Filmweb.get_movie方法代碼示例

本文整理匯總了Python中filmweb.Filmweb.get_movie方法的典型用法代碼示例。如果您正苦於以下問題:Python Filmweb.get_movie方法的具體用法?Python Filmweb.get_movie怎麽用?Python Filmweb.get_movie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在filmweb.Filmweb的用法示例。


在下文中一共展示了Filmweb.get_movie方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: SztukaKochaniaTest

# 需要導入模塊: from filmweb import Filmweb [as 別名]
# 或者: from filmweb.Filmweb import get_movie [as 別名]
class SztukaKochaniaTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(763312)

    def test_cast(self):
        self.assertEquals(len(self.movie['cast']), 30)
        self.assertNotEqual(self.movie['cast'][-1]['roleType'], 'aktor')
        self.assertEquals(len(self.movie['photos']), 28)
開發者ID:hoffmannkrzysztof,項目名稱:filmwebpy,代碼行數:11,代碼來源:tests.py

示例2: EpisodesTest

# 需要導入模塊: from filmweb import Filmweb [as 別名]
# 或者: from filmweb.Filmweb import get_movie [as 別名]
class EpisodesTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(130177) #Dr House
    def test_episode(self):
        episode = self.movie['episodes'][47]
        self.assertEqual(episode['name'],u'Cane & Able')
        self.assertEqual(episode['season'],3)
        self.assertEqual(episode['number'],2)
        self.assertEqual(episode['date'],datetime.strptime("2006-09-12","%Y-%m-%d" ))
開發者ID:Arthan,項目名稱:filmwebpy,代碼行數:12,代碼來源:tests.py

示例3: XmenImagesGalleryTest

# 需要導入模塊: from filmweb import Filmweb [as 別名]
# 或者: from filmweb.Filmweb import get_movie [as 別名]
class XmenImagesGalleryTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(489280)

    def test_images(self):
        self.assertEqual(len(self.movie['photos']), 46)

        for photo in self.movie['photos']:
            self.assertIsNotNone(is_valid_url(photo['image']), msg=photo['image'])
開發者ID:hoffmannkrzysztof,項目名稱:filmwebpy,代碼行數:12,代碼來源:tests.py

示例4: CheckMovieInfos

# 需要導入模塊: from filmweb import Filmweb [as 別名]
# 或者: from filmweb.Filmweb import get_movie [as 別名]
class CheckMovieInfos(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(107552)

    def test_in(self):
        found_movies = self.fa.search_movie(u'Dziewczyna z sąsiedztwa')
        self.assertTrue( self.movie in found_movies )

    def test_levenstein(self):
        org_title = u'The Girl Next Door'.replace("The","")
        self.assertEqual('The Girl Next Door',self.movie['title_original'])
        self.assertEqual( Levenshtein.distance(org_title,self.movie['title_original'].replace("The","")) , 0 )
開發者ID:Arthan,項目名稱:filmwebpy,代碼行數:15,代碼來源:tests.py

示例5: Movieparser

# 需要導入模塊: from filmweb import Filmweb [as 別名]
# 或者: from filmweb.Filmweb import get_movie [as 別名]
class Movieparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(671)

    def test_in(self):
        found_movies = self.fa.search_movie('Leon zawodowiec')
        self.assertTrue(self.movie in found_movies)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        self.assertEqual(len(self.movie['cast']), 101)

        p = self.movie['cast'][0]
        self.assertEqual(p['title'], u'Jean Reno')
        self.assertEqual(p['roleName'], u'Léon')
        self.assertEqual(p['roleType'], u'aktor')
        self.assertEqual(p.objID, 88)

        for type in ['aktor', u'reżyser', 'scenarzysta', u'zdjęcia', 'muzyka', u'montaż', 'scenografia', 'kostiumy',
                     'producent', u'dźwięk']:
            self.assertTrue(
                any([cast for cast in self.movie['cast'] if cast['roleType'] == type]), msg='missing %s' % type
            )

    def test_infos(self):
        self.assertEqual(len(self.movie['additionalinfo']), 5)

        self.assertEqual(len(self.movie['basicinfo']), 5)

        self.assertEqual(len(self.movie['photos']), 45)

        self.assertEqual('Leon zawodowiec', self.movie.title, )
        # self.assertEqual('Léon',self.movie['title_original'],)

    def test_year(self):
        self.assertEqual(self.movie['year'], '1994')
開發者ID:hoffmannkrzysztof,項目名稱:filmwebpy,代碼行數:39,代碼來源:tests.py


注:本文中的filmweb.Filmweb.get_movie方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。