Skip to content

Comments

Unit tests (Sprint 4)#1

Open
hinatakudo5 wants to merge 8 commits intomainfrom
develop
Open

Unit tests (Sprint 4)#1
hinatakudo5 wants to merge 8 commits intomainfrom
develop

Conversation

@hinatakudo5
Copy link
Owner

No description provided.

tests.py Outdated
books = collector.get_books_genre()
assert book_name in books
# у только что добавленной книги жанр не задан
assert books[book_name] is None

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее проверяется books[book_name] is None, но по коду класса книга добавляется с пустым строковым значением (''), а не None. тест будет падать, хотя логика класса верна.

collector.set_book_genre('Азбука', 'FFFFFF')
assert collector.books_genre['Азбука'] == ''
books = collector.get_books_genre()
assert book_name in books

Choose a reason for hiding this comment

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

Нужно исправить здесь и далее: нарушает Эля требование «один тест — один assert».

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('Азбука')
collector.add_book_in_favorites('Алгебра')
assert collector.get_list_of_favorites_books() == ['Азбука', 'Алгебра'] No newline at end of file
assert collector.get_list_of_favorites_books() == ['Азбука', 'Алгебра']

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