Skip to content

Sprint_4#7

Open
PLAYERZOYA wants to merge 5 commits into
mainfrom
develop
Open

Sprint_4#7
PLAYERZOYA wants to merge 5 commits into
mainfrom
develop

Conversation

@PLAYERZOYA
Copy link
Copy Markdown
Owner

тест, который был изначально, не работает, но я не стала его трогать

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Необходимо исправить: эта директория лишняя в проекте. Необходимо убрать её из ветки и добавить в .gitignore в корне проекта

Comment thread tests.py

from main import BooksCollector

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.

Можно лучше: в модулях с тестами должны быть только тесты. Стоит вынести в отдельный модуль data

Comment thread tests.py
collector.add_new_book('Гордость и предубеждение и зомби')
collector.add_new_book('Что делать, если ваш кот хочет вас убить')
collector.add_new_book("Гордость и предубеждение и зомби")
collector.add_new_book("Что делать, если ваш кот хочет вас убить")
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
Comment on lines +112 to +151
def test_add_new_book_add_empty_string(self):

collector = BooksCollector()

collector.add_new_book("")

assert len(collector.get_books_genre()) == 0


def test_add_new_book_add_lenght_1(self):

collector = BooksCollector()

collector.add_new_book("В")

assert len(collector.get_books_genre()) == 1


def test_add_new_book_add_lenght_39(self):

collector = BooksCollector()

collector.add_new_book("ВиноизодуванчиковВиноизодуванчиковВинои")

assert len(collector.get_books_genre()) == 1


def test_add_new_book_add_lenght_40(self):

collector = BooksCollector()

collector.add_new_book("ВиноизодуванчиковВиноизодуванчиковВиноиз")

assert len(collector.get_books_genre()) == 1


def test_add_new_book_add_lenght_41(self):

collector = BooksCollector()

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