Skip to content

Conversation

@vladslav-ya
Copy link
Collaborator

Тестирование приложения BooksCollector

tests.py Outdated

# класс TestBooksCollector объединяет набор тестов, которыми мы покрываем наше приложение BooksCollector
# обязательно указывать префикс Test
name_n_genre = [["Тень за стеной", "Ужасы"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Нужно исправить: тестовые данные хранятся в data

tests.py Outdated
Comment on lines 11 to 17
@pytest.fixture
def collector_with_books(self):
collector = BooksCollector()
for name, genre in name_n_genre:
collector.add_new_book(name)
collector.set_book_genre(name, genre)
return collector
Copy link
Collaborator

Choose a reason for hiding this comment

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

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


# напиши свои тесты ниже
# чтобы тесты были независимыми в каждом из них создавай отдельный экземпляр класса BooksCollector()
assert set(list_favorite_books) == {first_book, second_book}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Нужно исправить: отсутствуют тесты на проверку методов get_book_genre и get_list_of_favorites_books

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