def test_cannot_add_movie_with_non_unique_id(): mem_repo = MemoryRepository() up_movie = Movie("Up", 2009, 1) klaus_movie = Movie("Klaus", 2019, 1) mem_repo.add_movie(up_movie) mem_repo.add_movie(klaus_movie) assert mem_repo.get_number_of_movies() == 1
def test_get_number_of_movies(): mem_repo = MemoryRepository() up_movie = Movie("Up", 2009, 1) klaus_movie = Movie("Klaus", 2019, 2) dolittle_movie = Movie("Dolittle", 2019, 3) mem_repo.add_movie(up_movie) mem_repo.add_movie(klaus_movie) mem_repo.add_movie(dolittle_movie) assert mem_repo.get_number_of_movies() == 3