Skip to content

Задание_1 - #930

Open
Korot1sh wants to merge 4 commits into
Yandex-Practicum:mainfrom
Korot1sh:develop1
Open

Korot1sh wants to merge 4 commits into
Yandex-Practicum:mainfrom
Korot1sh:develop1

Conversation

@Korot1sh

@Korot1sh Korot1sh commented Oct 5, 2026

Copy link
Copy Markdown

No description provided.

@irisqul irisqul left a comment

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 __pycache__/__init__.cpython-314.pyc Outdated

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/bun_test.py Outdated
def test_get_name_returns_bun_name(name, price):
bun = Bun(name, price)

assert bun.get_name() == name

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_price

Comment thread tests/burger_test.py
from unittest.mock import Mock
from burger import Burger


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/burger_test.py Outdated
"(==== black bun ====)\n"
"\n"
"Price: 250"
) No newline at end of file

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/ingredient_test.py Outdated
def test_get_type_returns_ingredient_type(ingredient_type):
ingredient = Ingredient(ingredient_type, "ingredient", 100)

assert ingredient.get_type() == ingredient_type No newline at end of file

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/burger_test.py Outdated


class TestBurger:
@pytest.fixture

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread tests/ingredient_test.py Outdated


class TestIngredient:
@pytest.fixture

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread tests/ingredient_test.py
def ingredient(self):
return Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 50)

def test_get_price_returns_ingredient_price(self, ingredient):

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