def test_repository_can_retrieve_actor(session_factory): repo = SqlAlchemyRepository(session_factory) name = "Chris Pratt" actor = repo.get_actor(name) assert actor.actor_full_name == "Chris Pratt"
def test_repository_returns_none_for_non_existent_actor(session_factory): repo = SqlAlchemyRepository(session_factory) name = "Dave Sam" actor = repo.get_actor(name) assert actor is None
def test_add_and_get_actor(session_factory): repository = SqlAlchemyRepository(session_factory) repository.add_actor(Actor("Ikue Ootani")) assert repository.get_actor("Ikue Ootani") == Actor("Ikue Ootani") assert repository.get_actor("Satomi Arai") is None