def test_repository_returns_an_empty_list_for_non_existent_ids( session_factory): repo = SqlAlchemyRepository(session_factory) movies = repo.get_movies_by_id([0, 1001]) assert len(movies) == 0
def test_repository_does_not_retrieve_movie_for_non_existent_id( session_factory): repo = SqlAlchemyRepository(session_factory) movies = repo.get_movies_by_id([2, 209]) assert len(movies) == 1 assert movies[0].title == 'Prometheus'
def test_repository_can_get_movies_by_ids(session_factory): repo = SqlAlchemyRepository(session_factory) movies = repo.get_movies_by_id([2, 3, 4]) assert len(movies) == 3 assert movies[0].title == 'Prometheus' assert movies[1].title == "Split" assert movies[2].title == 'Sing'