Skip to content

Sprint_4#6

Open
kamilachka2909-ctrl wants to merge 4 commits intomainfrom
develop
Open

Sprint_4#6
kamilachka2909-ctrl wants to merge 4 commits intomainfrom
develop

Conversation

@kamilachka2909-ctrl
Copy link
Owner

No description provided.

]
)
def test_set_book_genre_valid_input_genre_assigned(self, name, genre):
collector = BooksCollector()

Choose a reason for hiding this comment

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

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

books_in_genre = collector.get_books_with_specific_genre(genre)

# Проверяем, что все добавленные книги вернулись
assert books_in_genre == books

Choose a reason for hiding this comment

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

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

collector = BooksCollector()

# Проверяем, что у нового объекта словарь пуст
assert collector.get_books_genre() == {}

Choose a reason for hiding this comment

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

Нужно исправить: обязательно должна быть позитивная проверка возвращения словаря

collector.set_book_genre(name, genre)

# Проверяем, что книга попала в список детских
assert name in collector.get_books_for_children()

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.

2 participants

Comments