Ejemplo n.º 1
0
    def test_external_link_compare_tmdb_success(self, browser_mock, base_init_mock, site_mock):
        site_mock.browser = browser_mock
        inserter = TraktRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = 'Trakt'
        inserter.failed_movies = []

        result = inserter._compare_external_links(self.movie_details_page, self.movie, 'themoviedb.org', 'tmdb')  # pylint: disable=protected-access

        self.assertTrue(result)
Ejemplo n.º 2
0
    def test_external_link_compare_imdb_fail(self, browser_mock, base_init_mock, site_mock):
        site_mock.browser = browser_mock
        inserter = TraktRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = 'Trakt'
        inserter.failed_movies = []

        movie2 = dict()
        movie2['title'] = 'Fight Club'
        movie2['year'] = 1999
        movie2['imdb'] = dict()
        movie2['imdb']['id'] = 'tt0137523'
        movie2['imdb']['url'] = 'https://www.imdb.com/title/tt0137523'
        movie2['imdb']['my_rating'] = 10

        result = inserter._compare_external_links(self.movie_details_page, movie2, 'imdb.com', 'imdb')  # pylint: disable=protected-access

        self.assertTrue(result)
Ejemplo n.º 3
0
    def test_external_link_compare_tmdb_fail(self, browser_mock, base_init_mock, site_mock):
        site_mock.browser = browser_mock
        inserter = TraktRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = 'Trakt'
        inserter.failed_movies = []

        movie2 = dict()
        movie2['title'] = 'Arrival'
        movie2['year'] = 2006
        movie2['tmdb'] = dict()
        movie2['tmdb']['id'] = '329865'
        movie2['tmdb']['url'] = 'https://www.themoviedb.org/movie/329865'
        movie2['tmdb']['my_rating'] = 7

        result = inserter._compare_external_links(self.movie_details_page, movie2, 'themoviedb.org', 'tmdb')  # pylint: disable=protected-access

        self.assertFalse(result)
    def test_external_link_compare_imdb_fail(self, browser_mock,
                                             base_init_mock, site_mock):
        site_mock.browser = browser_mock
        inserter = TraktRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = "Trakt"
        inserter.failed_movies = []

        movie2 = dict()
        movie2["title"] = "Fight Club"
        movie2["year"] = 1999
        movie2["imdb"] = dict()
        movie2["imdb"]["id"] = "tt0137523"
        movie2["imdb"]["url"] = "https://www.imdb.com/title/tt0137523"
        movie2["imdb"]["my_rating"] = 10

        result = inserter._compare_external_links(self.movie_details_page,
                                                  movie2, "imdb.com", "imdb")  # pylint: disable=protected-access

        self.assertTrue(result)
    def test_external_link_compare_tmdb_fail(self, browser_mock,
                                             base_init_mock, site_mock):
        site_mock.browser = browser_mock
        inserter = TraktRatingsInserter(None)
        inserter.site = site_mock
        inserter.site.site_name = "Trakt"
        inserter.failed_movies = []

        movie2 = dict()
        movie2["title"] = "Arrival"
        movie2["year"] = 2006
        movie2["tmdb"] = dict()
        movie2["tmdb"]["id"] = "329865"
        movie2["tmdb"]["url"] = "https://www.themoviedb.org/movie/329865"
        movie2["tmdb"]["my_rating"] = 7

        result = inserter._compare_external_links(self.movie_details_page,
                                                  movie2, "themoviedb.org",
                                                  "tmdb")  # pylint: disable=protected-access

        self.assertFalse(result)