def test_get_imdb_movie_url(self): """ This test getting the movie url :return: """ self.assertEqual(queryimdb.get_imdb_movie_url("tt0102685"), "http://www.imdb.com/title/tt0102685/")
def test_get_release_date(self): """ This test getting the release date :return: """ res = requests.get(queryimdb.get_imdb_movie_url("tt0102685")) mysoup = bs4.BeautifulSoup(res.text, "lxml") temp = queryimdb.get_release_date(mysoup,"tt0102685") release_date = unicodedata.normalize('NFKD', temp).encode('ascii', 'ignore') self.assertEqual(release_date,' 12 July 1991')
def test_get_director_actors(self): """ This test getting the actors and director :return: """ res = requests.get(queryimdb.get_imdb_movie_url("tt0102685")) mysoup = bs4.BeautifulSoup(res.text, "lxml") director, actors = queryimdb.get_director_actors(mysoup) self.assertEqual(director,"Kathryn Bigelow") self.assertEqual(actors,' Patrick Swayze, Keanu Reeves, Gary Busey, Lori Petty')
def test_get_movie_poster_url(self): """ This test getting the movie poster url :return: """ res = requests.get(queryimdb.get_imdb_movie_url("tt0102685")) mysoup = bs4.BeautifulSoup(res.text, "lxml") self.assertEqual(queryimdb.get_movie_poster_url(mysoup), "http://ia.media-imdb.com/images/M/MV5BMTIwNTk1MT" "gxMF5BMl5BanBnXkFtZTcwODI4NDUzMQ@@._V1_UY1200_CR126,0,630,1200_AL_.jpg")