本文整理汇总了Python中filmweb.Filmweb.search_movie方法的典型用法代码示例。如果您正苦于以下问题:Python Filmweb.search_movie方法的具体用法?Python Filmweb.search_movie怎么用?Python Filmweb.search_movie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filmweb.Filmweb
的用法示例。
在下文中一共展示了Filmweb.search_movie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CheckMovieInfos
# 需要导入模块: from filmweb import Filmweb [as 别名]
# 或者: from filmweb.Filmweb import search_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 )
示例2: Movieparser
# 需要导入模块: from filmweb import Filmweb [as 别名]
# 或者: from filmweb.Filmweb import search_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')