Exemplo n.º 1
0
    def test_find_movie_success(self, browser_mock, base_init_mock, site_mock, tiles_mock, equality_mock):  # pylint: disable=too-many-arguments
        site_mock.browser = browser_mock
        browser_mock.page_source = self.search_results
        inserter = MetacriticRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = 'Metacritic'
        inserter.failed_movies = []
        tiles_mock.return_value = self.search_result_tile_list
        equality_mock.return_value = True

        result = inserter._find_movie(self.movie)  # pylint: disable=protected-access

        self.assertTrue(result)
Exemplo n.º 2
0
    def test_find_movie_fail(self, browser_mock, base_init_mock, site_mock, tiles_mock, equality_mock):  # pylint: disable=too-many-arguments
        site_mock.browser = browser_mock
        browser_mock.page_source = self.search_results
        inserter = MetacriticRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = 'Metacritic'
        inserter.failed_movies = []
        tiles_mock.return_value = self.search_result_tile_list
        equality_mock.return_value = False

        movie2 = dict()
        movie2['title'] = 'The Matrix'
        movie2['year'] = 1995

        result = inserter._find_movie(movie2)  # pylint: disable=protected-access

        self.assertFalse(result)