-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint_2 #4
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?
Sprint_2 #4
Conversation
tests_books_collector.py
Outdated
|
|
||
| class TestBooksCollector: | ||
| #Фикстура collector - создает новый экземпляр класса для каждого теста | ||
| @pytest.fixture |
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 collector.get_list_of_favorites_books() == ['Скотный двор', 'Мы'] | ||
|
|
||
| # Проверяем что метод get_book_genre возвращает правильный жанр | ||
| def test_get_book_genre(self, collector): |
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.
Нужно исправить: тест аналогичен set_book_genre. Попробуй установить значение жанра иначе, или иначе получить его для сравнения. Используй доступ к словарю. В идеале - в каждом тесте нужно использовать только один проверяемый метод
| ]) | ||
| def test_add_new_book(self, collector, name, expected): | ||
| collector.add_new_book(name) | ||
| assert (name in collector.get_books_genre()) == expected |
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.
Нужно исправить: нужны отдельные тесты для add_new_book и get_books_genre()
…k_genre, фикстура вынесена в файл
Добавлен README и тесты для BooksCollector