コード例 #1
0
    def test_heil_caesar(self):
        input_name = "Hail, Caesar!"
        mc_name = mc.convert_name_to_mc(input_name)
        reference_name = 'hail-caesar!'
        assert mc_name == reference_name


# No pageviews found for black-cat,-white-cat
# No pageviews found for o-brother,-where-art-thou?
コード例 #2
0
ファイル: functions.py プロジェクト: JanDebiec/MovieDB
def insert_rating_for_movie_from_html(movie_id, movie_html):
    mc_rating, count, list_ = mc.get_rating_list_for_movie(movie_id, movie_html)
    if mc_rating > 0:
        add_mc_rating_for_movie(mc_rating, movie_id)
    if count > 0:
        # add_mc_rating_for_movie(mc_rating, movie_id)

        for item in list_:
            name = '{}'.format(item.author) # only author, without newspaper
            name_mc = mc.convert_name_to_mc(name)
            url = 'http://www.metacritic.com/critic/{}?filter=movies'.format(name_mc)
            maxVal = 100.0
            crit_obj = Critic(name=name, url=url, maxVal=maxVal)
            crit_id = add_critic(crit_obj)
            rat = Rating(movie_id, critic_id=crit_id, value=item.rating)
            add_rating(rat)
コード例 #3
0
 def test_space_odysee(self):
     input_name = "2001: A Space Odyssey"
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = '2001-a-space-odyssey'
     assert mc_name == reference_name
コード例 #4
0
 def test_name_with_apo_middle(self):
     input_name = "Dr.A.A. O'Names"
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'draa-onames'
     assert mc_name == reference_name
コード例 #5
0
 def test_name_with_dot_middle(self):
     input_name = 'Dr.A.A. Names'
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'draa-names'
     assert mc_name == reference_name
コード例 #6
0
 def test_name_with_dot_end(self):
     input_name = 'Robert Yannis Jr.'
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'robert-yannis-jr'
     assert mc_name == reference_name
コード例 #7
0
 def test_three_words(self):
     input_name = 'I kill Giants'
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'i-kill-giants'
     assert mc_name == reference_name
コード例 #8
0
 def test_two_words(self):
     input_name = 'The Godfather'
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'the-godfather'
     assert mc_name == reference_name
コード例 #9
0
 def test_one_word(self):
     input_name = 'Sicario'
     mc_name = mc.convert_name_to_mc(input_name)
     reference_name = 'sicario'
     assert mc_name == reference_name