-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Develop1 #631
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?
Develop1 #631
Conversation
tests/test_burger.py
Outdated
| # - test_set_buns_sets_bun: проверяет базовый сценарий первого вызова метода. | ||
| # - test_set_buns_uses_latest_bun: проверяет сценарий повторного вызова метода(обновление состояния) | ||
|
|
||
| def test_set_buns_sets_bun(burger): |
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.
Нужно исправить здесь и далее: Для корректного запуска тестов необходимо код с шагами теста поместить в тестовый метод (нейминг начинается с test_), а метод - в тестовый класс (нейминг начинается с Test). Необходимо привести к такому формату все модули внутри пакета tests
tests/test_burger.py
Outdated
| assert lines[0] == "(==== black bun ====)" | ||
| assert lines[1] == "= sauce hot sauce =" | ||
| assert lines[2] == "(==== black bun ====)" | ||
| assert lines[3] == "" # пустая строка | ||
| assert lines[4].startswith("Price: ") # цена начинается с Price | ||
|
|
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.
Необходимо исправить: стоит сравнивать весь вывод от get_receipt целиком, а не построчно
Краткое резюме проделанной работы (с указанием классов)
Создана фикстура burger в conftest.py, предоставляющая новый экземпляр класса Burger.
Протестированы все методы класса Burger:
set_buns
add_ingredient
remove_ingredient
move_ingredient
get_price
get_receipt