Skip to content

sprint-4#10

Open
ShamilovR wants to merge 1 commit intomasterfrom
sprint_4
Open

sprint-4#10
ShamilovR wants to merge 1 commit intomasterfrom
sprint_4

Conversation

@ShamilovR
Copy link
Copy Markdown
Owner

No description provided.

long_name = ('A' * 41)
collector.add_new_book(long_name)
assert long_name not in collector.get_books_genre()
# assert len(long_name) == 40
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Нужно исправить: решение не должно содержать закомментированный код


children_books = collector.get_books_for_children()

assert 'name' not in children_books
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Нужно исправить: здесь должно обращение к переменной name , а не использование строки 'name'

class TestBooksCollector:

def test_add_new_book_add_two_books(self):
collector = BooksCollector()
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Можно лучше: создание объекта BooksCollector можно вынести в фикстуры

def test_add_book_in_favorites_with_genre(self):
collector = BooksCollector()
collector.add_new_book('Рыцари Сорока Островов')
collector.set_book_genre('Рыцари Сорока Островов', 'Фантастика')
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Можно лучше: здесь и далее: для тестов проверки favorites - не обязательно устанавливать жанр книги

Comment on lines +42 to +44
not_at_list_genre = collector.get_book_genre(book_name)

assert book_name not in not_at_list_genre
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Отсутствует коммент: метод .get_book_genre возвращает жандр книги, в данном случае он вернет пустую строку.
Проверка что название книги не содержится в пустой строке не может считаться валидной для проверки установки жанра не из списка

collector.add_new_book('Рыцари Сорока Островов')
collector.set_book_genre('Рыцари Сорока Островов', 'Фантастика')
book_collection = collector.get_books_genre()
assert 'Рыцари Сорока Островов' in book_collection
Copy link
Copy Markdown

@AlexKitIt AlexKitIt Jan 25, 2025

Choose a reason for hiding this comment

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

Отсутствует коммент: Нужно исправить: здесь и далее: в юнит тестах assert ставится только на проверяемой функциональности, методы добавления книги и получения книг проверяются в рамках других юнит тестов

collector = BooksCollector()
collector.add_new_book('Звездный лабиринт:Черновик')
collector.set_book_genre('Звездный лабиринт:Черновик', 'Фантастика')
book_collection = collector.get_books_genre()
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.

2 participants