def test_empty_removes_all_entities(repo: Repository) -> None: """ Given: A full repository When: calling empty Then: No entity remains in the repository """ books = BookFactory.batch(25) genres = GenreFactory.batch(20) repo.add(books) repo.add(genres) repo.commit() result = repo.empty() assert result is None assert repo.all(Book) == [] assert repo.all(Genre) == []
def get_books() -> List[Book]: """Return some books.""" return BookFactory.batch(5)