Skip to content

Conversation

@HeavyRain6647
Copy link
Owner

No description provided.

tests.py Outdated

# напиши свои тесты ниже
# чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector()
# чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector()

Choose a reason for hiding this comment

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

Нужно исправить: в примере неверный ассерт. Исправь его или убери тест

tests.py Outdated
# чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector()
# Тестирование добавления одной книги
def test_add_new_book_single_book(self):
collector = BooksCollector()

Choose a reason for hiding this comment

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

Можно улучшить: предусловие, общее для всех тестов, лучше вынести в фикстуру

tests.py Outdated
[("Алиса в стране чудес", "Мультфильмы"),
("Франкенштейн", "Ужасы"),
("Код да Винчи", "Детективы")])
def test_get_book_genre(self, book_name, genre):

Choose a reason for hiding this comment

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

Нужно исправить: тест аналогичен set_book_genre. Попробуй установить значение жанра иначе, или иначе получить его для сравнения. Используй доступ к словарю

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)

Choose a reason for hiding this comment

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

Можно улучшить: задача метода - выбор нужных книг из списка, а в тесте возвращаются все.

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

Choose a reason for hiding this comment

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

Нужно исправить: не протестировано, что метод выбирает нужные книги

tests.py Outdated
collector.add_book_in_favorites(book_name)

# Проверяем добавление в избранное
assert book_name in collector.favorites

Choose a reason for hiding this comment

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

Нужно исправить: добавление проверено в прошлом тесте

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