Skip to content

Выполнение итогового задания 4 спринта#5

Open
ElenkaDyshpan wants to merge 2 commits intomainfrom
develop
Open

Выполнение итогового задания 4 спринта#5
ElenkaDyshpan wants to merge 2 commits intomainfrom
develop

Conversation

@ElenkaDyshpan
Copy link
Owner

No description provided.

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

def test_init_favorites_len_is_zero(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
assert collector.get_book_genre(book_name) == ''

# проверяем, что по имени книги получаем жанр
def test_get_book_genre_true(self):

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
collector.set_book_genre(book, genre)

# проверяем, что при список получаемый по жанру в переменной genre соответтствует списку books_list
assert collector.get_books_with_specific_genre(genre) == books_list

Choose a reason for hiding this comment

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

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

tests.py Outdated
books_genre = collector.get_books_genre()

# проверяем что books_genre содержит все книги с их жанрами
assert len(books_genre) == len(books_list)

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