Skip to content

Conversation

@Airflp
Copy link
Collaborator

@Airflp Airflp commented Jan 30, 2026

Добавлены unit-тесты для класса BooksCollector.
Покрыты основные методы:

  • add_new_book
  • set_book_genre
  • get_book_genre
  • get_books_with_specific_genre
  • get_books_for_children
  • add_book_in_favorites
  • delete_book_from_favorites
  • get_list_of_favorites_books

tests.py Outdated
# создаем экземпляр (объект) класса BooksCollector
def test_initial_state(self):
collector = BooksCollector()
assert collector.get_books_genre() == {} and collector.get_list_of_favorites_books() == []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: по сути данный тест не имеет шагов, потому его проектирование неоптимально. Если оставить тесты на проверку начального состояния, то стоит соблюдать правило 1 тест - 1 assert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants