def test_watchlist_size(): watchlist = WatchList() assert watchlist.size() == 0 movie1 = Movie("Moana", 2016) movie2 = Movie("Frozen", 2014) watchlist.add_movie(movie1) assert watchlist.size() == 1 watchlist.add_movie(movie2) assert watchlist.size() == 2 watchlist.remove_movie(movie1) assert watchlist.size() == 1
def test_watch_list_add_and_remove_movie(): watchlist6 = WatchList() watchlist6.add_movie(Movie("Moana", 2016)) watchlist6.remove_movie(Movie("Moana", 2016)) assert watchlist6.watch_list == [] assert watchlist6.size() == 0
def test_watch_list_remove_movie(): watchlist5 = WatchList() watchlist5.add_movie(Movie("Moana", 2016)) watchlist5.remove_movie(Movie("Transformers", 2007)) assert watchlist5.size() == 1 assert repr(watchlist5.first_movie_in_watchlist()) == "<Movie Moana, 2016>"
def test_watch_list_check_size(): watchlist4 = WatchList() watchlist4.add_movie(Movie("Moana", 2016)) watchlist4.add_movie(Movie("Ice Age", 2002)) assert watchlist4.size() == 2
def test_watch_list_init(): watchlist1 = WatchList() assert watchlist1.watch_list == [] assert watchlist1.size() == 0