-
Notifications
You must be signed in to change notification settings - Fork 21
Изменения в tests.py #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
tests.py
Outdated
| @pytest.fixture | ||
| def collector(self): | ||
| return BooksCollector() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно исправить: фикстуры живут в conftest
tests.py
Outdated
| def test_add_new_book_incorrect_add_book_unsuccessful_add(self, collector): | ||
| collector.add_new_book('Азбука') | ||
| assert len(collector.get_books_genre()) == 1 | ||
| collector.add_new_book('Азбука') | ||
| assert len(collector.get_books_genre()) == 1 | ||
| collector.add_new_book('Азбука' * 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно исправить: в юнит тесте assert один и это должен быть параметризованный тест
tests.py
Outdated
| def test_set_book_genre_incorrect_genre_unsuccess(self, collector): | ||
| collector.set_book_genre('Азбука', 'Ужасы') | ||
| assert len(collector.books_genre) == 0 | ||
| collector.add_new_book('Азбука') | ||
| collector.set_book_genre('Азбука', 'FFFFFF') | ||
| assert collector.books_genre['Азбука'] == '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь и далее: comment up
No description provided.