def test_watchlist_remove(): watchlist = WatchList() watchlist.add_movie(Movie("Moana", 2016)) watchlist.add_movie(Movie("Ice Age", 2002)) watchlist.add_movie(Movie("Guardians of the Galaxy", 2012)) watchlist.remove_movie(Movie("Moana", 2016)) #print(watchlist.first_movie_in_watchlist()) assert repr(watchlist.first_movie_in_watchlist()) == "<Movie Ice Age, 2002>"
def test_watchlist_remove_movie_not_in_watchlist(): watchlist = WatchList() watchlist.add_movie(Movie("Moana", 2016)) watchlist.add_movie(Movie("Ice Age", 2002)) watchlist.remove_movie(Movie("Guardians of the Galaxy", 2012)) watchlist_iter = iter(watchlist) #print(next(watchlist_iter)) #print(next(watchlist_iter)) assert repr(next(watchlist_iter)) == "<Movie Moana, 2016>" assert repr(next(watchlist_iter)) == "<Movie Ice Age, 2002>"