Open
Conversation
Ayantea1
reviewed
Sep 15, 2025
tests.py
Outdated
| # чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector() | ||
|
|
||
| def test_init_favorites_len_is_zero(self): | ||
| collector = BooksCollector() |
There was a problem hiding this comment.
можно улучить: для одинакового для всех тестов предусловия можно создать фикстуру
Ayantea1
reviewed
Sep 15, 2025
tests.py
Outdated
| assert collector.get_book_genre(book_name) == '' | ||
|
|
||
| # проверяем, что по имени книги получаем жанр | ||
| def test_get_book_genre_true(self): |
There was a problem hiding this comment.
Нужно исправить:тест аналогичен set_book_genre. Попробуй установить значение жанра иначе, или иначе получить его для сравнения. Используй доступ к словарю
Ayantea1
reviewed
Sep 15, 2025
tests.py
Outdated
| collector.set_book_genre(book, genre) | ||
|
|
||
| # проверяем, что при список получаемый по жанру в переменной genre соответтствует списку books_list | ||
| assert collector.get_books_with_specific_genre(genre) == books_list |
There was a problem hiding this comment.
можно улучшить: суть метода в том, чтобы выбрать нужные книги, а в тесте возвращаются все
Ayantea1
reviewed
Sep 15, 2025
tests.py
Outdated
| books_genre = collector.get_books_genre() | ||
|
|
||
| # проверяем что books_genre содержит все книги с их жанрами | ||
| assert len(books_genre) == len(books_list) |
There was a problem hiding this comment.
Нужно исправить: ассерт должен касаться только основной проверки текста
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.