def test_parser( self, site_mock, base_init_mock, browser_mock, parse_movie_mock, progress_print_mock, ): # pylint: disable=too-many-arguments browser_mock.page_source = self.my_ratings parser = TraktRatingsParser(None) parser.args = False parser.movies = [] parser.site = site_mock parser.site.site_name = "Trakt" parser.site.browser = browser_mock parser.args = None parser.parse() self.assertEqual(60, parse_movie_mock.call_count) self.assertEqual(60, len(parser.movies)) self.assertEqual(dict, type(parser.movies[0])) self.assertEqual("Arrival", parser.movies[0]["title"]) self.assertEqual("210803", parser.movies[0]["trakt"]["id"]) self.assertEqual("https://trakt.tv/movies/arrival-2016", parser.movies[0]["trakt"]["url"])
def test_parser(self, site_mock, base_init_mock, browser_mock, parse_movie_mock, progress_print_mock): # pylint: disable=too-many-arguments browser_mock.page_source = self.my_ratings parser = TraktRatingsParser(None) parser.args = False parser.movies = [] parser.site = site_mock parser.site.site_name = 'Trakt' parser.site.browser = browser_mock parser.args = None parser.parse() self.assertEqual(60, parse_movie_mock.call_count) self.assertEqual(60, len(parser.movies)) self.assertEqual(dict, type(parser.movies[0])) self.assertEqual('Arrival', parser.movies[0]['title']) self.assertEqual('210803', parser.movies[0]['trakt']['id']) self.assertEqual('https://trakt.tv/movies/arrival-2016', parser.movies[0]['trakt']['url'])