Open
Conversation
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
|
|
||
| # напиши свои тесты ниже | ||
| # чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector() No newline at end of file | ||
| # чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector() |
There was a problem hiding this comment.
Нужно исправить: в примере неверный ассерт. Исправь его или убери тест
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
| # чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector() | ||
| # Тестирование добавления одной книги | ||
| def test_add_new_book_single_book(self): | ||
| collector = BooksCollector() |
There was a problem hiding this comment.
Можно улучшить: предусловие, общее для всех тестов, лучше вынести в фикстуру
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
| [("Алиса в стране чудес", "Мультфильмы"), | ||
| ("Франкенштейн", "Ужасы"), | ||
| ("Код да Винчи", "Детективы")]) | ||
| def test_get_book_genre(self, book_name, genre): |
There was a problem hiding this comment.
Нужно исправить: тест аналогичен set_book_genre. Попробуй установить значение жанра иначе, или иначе получить его для сравнения. Используй доступ к словарю
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
| for book in books: | ||
| collector.add_new_book(book) | ||
| collector.set_book_genre(book, genre) | ||
| result = collector.get_books_with_specific_genre(genre) |
There was a problem hiding this comment.
Можно улучшить: задача метода - выбор нужных книг из списка, а в тесте возвращаются все.
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
| collector.add_new_book(book_name) | ||
| collector.set_book_genre(book_name, genre) | ||
| children_books = collector.get_books_for_children() | ||
| assert book_name in children_books |
There was a problem hiding this comment.
Нужно исправить: не протестировано, что метод выбирает нужные книги
Ayantea1
reviewed
Oct 28, 2025
tests.py
Outdated
| collector.add_book_in_favorites(book_name) | ||
|
|
||
| # Проверяем добавление в избранное | ||
| assert book_name in collector.favorites |
There was a problem hiding this comment.
Нужно исправить: добавление проверено в прошлом тесте
added 2 commits
November 6, 2025 19:51
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.