def test_repository_closes_connection(self, repo: Repository) -> None: """ Given: A configured repository When: calling the close method Then: the connection to the database is closed. """ repo.close() # act assert repo.is_closed
def test_repository_close_is_idempotent(self, repo: Repository) -> None: """ Given: A closed repository When: calling the close method Then: the connection to the database is closed and no exception is raised. """ repo.close() repo.close() # act assert repo.is_closed