Skip to content

Unit tests (Sprint 4)#1

Open
hinatakudo5 wants to merge 8 commits into
mainfrom
develop
Open

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

Conversation

@hinatakudo5

Copy link
Copy Markdown
Owner

No description provided.

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

Copy link
Copy Markdown

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. тест будет падать, хотя логика класса верна.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не исправлено

Comment thread 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() == ['Азбука', 'Алгебра']

Copy link
Copy Markdown

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