def test_repository_can_retrieve_movie(): mem_repo = MemoryRepository() movie = Movie("Up", 2009, 1) mem_repo.add_movie(movie) got_movie = mem_repo.get_movie(1) assert got_movie == movie
def test_repository_does_not_retrieve_a_non_existent_movie(): mem_repo = MemoryRepository() movie = Movie("Up", 2009, 1) mem_repo.add_movie(movie) got_movie = mem_repo.get_movie(7) assert got_movie is None
def test_repository_can_add_movie(): mem_repo = MemoryRepository() movie = Movie("Up", 2009, 1) mem_repo.add_movie(movie) assert mem_repo.get_movie(1) is movie