From 040c1ad5217febdbf44ad45a0dc14e1efb345d3d Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 12:19:05 +0100 Subject: [PATCH 01/54] Comment out Bun class and add test cases Comment out the Bun class and its methods, and add test cases for Bun. --- bun.py | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/bun.py b/bun.py index 5504bc1f4..f8923b57c 100644 --- a/bun.py +++ b/bun.py @@ -1,15 +1,33 @@ -class Bun: - """ - Модель булочки для бургера. - Булочке можно дать название и назначить цену. - """ +# class Bun: + # """ + # Модель булочки для бургера. + # Булочке можно дать название и назначить цену. + # """ +# + # def __init__(self, name: str, price: float): + # self.name = name + # self.price = price - def __init__(self, name: str, price: float): - self.name = name - self.price = price + #def get_name(self) -> str: + # return self.name - def get_name(self) -> str: - return self.name + #def get_price(self) -> float: + #return self.price - def get_price(self) -> float: - return self.price +#import pytest +#from praktikum.bun import Bun + + +class TestBun: + def test_bun_creation(self): + bun = Bun("Wheat Bun", 100.0) + assert bun.name == "Wheat Bun" + assert bun.price == 100.0 + + def test_get_name(self): + bun = Bun("Rye Bun", 120.0) + assert bun.get_name() == "Rye Bun" + + def test_get_price(self): + bun = Bun("Sesame Bun", 80.0) + assert bun.get_price() == 80.0 From 6a7ca58f1dffeed424760d074cf46c45725d2597 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:25:18 +0100 Subject: [PATCH 02/54] Create test_bun.py --- tests/test_bun.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_bun.py diff --git a/tests/test_bun.py b/tests/test_bun.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/test_bun.py @@ -0,0 +1 @@ + From 2e8b0abd753cbe37bc7592755d599e47193e3dfa Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:25:46 +0100 Subject: [PATCH 03/54] Add tests for Bun class in test_bun.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены тесты для класса Bun, включая инициализацию, параметры и проверку типа цены. --- tests/test_bun.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/test_bun.py b/tests/test_bun.py index 8b1378917..3356b86dc 100644 --- a/tests/test_bun.py +++ b/tests/test_bun.py @@ -1 +1,44 @@ +""" +Тесты для класса Bun из bun.py +""" +import pytest + +class TestBun: + """Тестирование модели булочки для бургера""" + + def test_bun_initialization(self): + """Проверка инициализации булочки с названием и ценой""" + # Arrange + name = "Красная булочка" + price = 150.0 + + # Act + bun = Bun(name, price) + + # Assert + assert bun.get_name() == name + assert bun.get_price() == price + + @pytest.mark.parametrize("name,price", [ + ("Черная булочка", 100.0), + ("Белая булочка", 200.0), + ("Солнечная булочка", 250.5), + ]) + def test_bun_getters_with_different_values(self, name, price): + """Параметризованный тест для разных значений булочек""" + # Arrange & Act + bun = Bun(name, price) + + # Assert + assert bun.get_name() == name + assert bun.get_price() == price + + def test_bun_price_is_float(self): + """Проверка, что цена возвращается как float""" + # Arrange & Act + bun = Bun("Тестовая булочка", 100) + + # Assert + assert isinstance(bun.get_price(), float) + assert bun.get_price() == 100.0 From c88d7b7752f89bd9296e215f6eb531e3fec54820 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:26:22 +0100 Subject: [PATCH 04/54] Create test_ingredient.py --- tests/test_ingredient.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_ingredient.py diff --git a/tests/test_ingredient.py b/tests/test_ingredient.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/test_ingredient.py @@ -0,0 +1 @@ + From 160829d08c9054fa1e9fd65fa662b5ccc6493fdc Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:26:46 +0100 Subject: [PATCH 05/54] Add tests for Ingredient class functionality Added tests for the Ingredient class, including initialization, type constants, and price validation. --- tests/test_ingredient.py | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/test_ingredient.py b/tests/test_ingredient.py index 8b1378917..21ac81b7f 100644 --- a/tests/test_ingredient.py +++ b/tests/test_ingredient.py @@ -1 +1,45 @@ +""" +Тесты для класса Ingredient из ingredient.py +""" +import pytest +from praktikum.ingredient import Ingredient +from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING + +class TestIngredient: + """Тестирование модели ингредиента""" + + @pytest.mark.parametrize("ingredient_type,name,price", [ + (INGREDIENT_TYPE_SAUCE, "Острый соус", 50.0), + (INGREDIENT_TYPE_FILLING, "Котлета", 100.0), + (INGREDIENT_TYPE_SAUCE, "Сырный соус", 75.5), + (INGREDIENT_TYPE_FILLING, "Салат", 30.0), + ]) + def test_ingredient_initialization_and_getters(self, ingredient_type, name, price): + """Параметризованный тест инициализации и геттеров ингредиента""" + # Arrange & Act + ingredient = Ingredient(ingredient_type, name, price) + + # Assert + assert ingredient.get_type() == ingredient_type + assert ingredient.get_name() == name + assert ingredient.get_price() == price + + def test_ingredient_types_constants(self): + """Проверка констант типов ингредиентов""" + # Arrange & Act + sauce_ingredient = Ingredient(INGREDIENT_TYPE_SAUCE, "Кетчуп", 40.0) + filling_ingredient = Ingredient(INGREDIENT_TYPE_FILLING, "Бекон", 120.0) + + # Assert + assert sauce_ingredient.get_type() == "SAUCE" + assert filling_ingredient.get_type() == "FILLING" + + def test_ingredient_price_is_float(self): + """Проверка, что цена ингредиента возвращается как float""" + # Arrange & Act + ingredient = Ingredient(INGREDIENT_TYPE_SAUCE, "Майонез", 45) + + # Assert + assert isinstance(ingredient.get_price(), float) + assert ingredient.get_price() == 45.0 From 52c48f7a3a902b93b708a753d7108862c8ec22a4 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:28:31 +0100 Subject: [PATCH 06/54] Create test_burger.py --- tests/test_burger.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_burger.py diff --git a/tests/test_burger.py b/tests/test_burger.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/test_burger.py @@ -0,0 +1 @@ + From d0b8fa1223a5e23cd9c0e884adf016f2706a765c Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:29:02 +0100 Subject: [PATCH 07/54] Implement tests for Burger class functionality Added comprehensive tests for the Burger class, including initialization, ingredient management, price calculation, and receipt generation. --- tests/test_burger.py | 231 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) diff --git a/tests/test_burger.py b/tests/test_burger.py index 8b1378917..6bed3c8e9 100644 --- a/tests/test_burger.py +++ b/tests/test_burger.py @@ -1 +1,232 @@ +""" +Тесты для класса Burger из burger.py +Включает использование моков и параметризации +""" +import pytest +from unittest.mock import Mock, patch +from praktikum.burger import Burger +from praktikum.bun import Bun +from praktikum.ingredient import Ingredient +from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING + +class TestBurger: + """Тестирование модели бургера""" + + def test_burger_initialization(self): + """Проверка инициализации пустого бургера""" + # Arrange & Act + burger = Burger() + + # Assert + assert burger.bun is None + assert burger.ingredients == [] + + def test_set_buns(self): + """Проверка установки булочек в бургер""" + # Arrange + burger = Burger() + mock_bun = Mock() + mock_bun.get_name.return_value = "Тестовая булочка" + mock_bun.get_price.return_value = 100.0 + + # Act + burger.set_buns(mock_bun) + + # Assert + assert burger.bun == mock_bun + + def test_add_ingredient(self): + """Проверка добавления ингредиента в бургер""" + # Arrange + burger = Burger() + mock_ingredient = Mock() + + # Act + burger.add_ingredient(mock_ingredient) + + # Assert + assert len(burger.ingredients) == 1 + assert burger.ingredients[0] == mock_ingredient + + def test_remove_ingredient(self): + """Проверка удаления ингредиента по индексу""" + # Arrange + burger = Burger() + mock_ingredient1 = Mock() + mock_ingredient2 = Mock() + mock_ingredient3 = Mock() + + burger.add_ingredient(mock_ingredient1) + burger.add_ingredient(mock_ingredient2) + burger.add_ingredient(mock_ingredient3) + + # Act + burger.remove_ingredient(1) # Удаляем второй ингредиент + + # Assert + assert len(burger.ingredients) == 2 + assert burger.ingredients[0] == mock_ingredient1 + assert burger.ingredients[1] == mock_ingredient3 + + @pytest.mark.parametrize("index,new_index,expected_order", [ + (0, 1, [1, 0, 2]), # Первый на место второго + (2, 0, [2, 0, 1]), # Третий на место первого + (1, 2, [0, 2, 1]), # Второй на место третьего + ]) + def test_move_ingredient(self, index, new_index, expected_order): + """Параметризованный тест перемещения ингредиентов""" + # Arrange + burger = Burger() + mock_ingredients = [Mock(), Mock(), Mock()] + + for ingredient in mock_ingredients: + burger.add_ingredient(ingredient) + + # Act + burger.move_ingredient(index, new_index) + + # Assert + # Проверяем новый порядок ингредиентов + for i, expected_idx in enumerate(expected_order): + assert burger.ingredients[i] == mock_ingredients[expected_idx] + + def test_get_price_with_mocks(self): + """Тест расчета цены бургера с использованием моков""" + # Arrange + burger = Burger() + + # Создаем моки для булочки и ингредиентов + mock_bun = Mock() + mock_ingredient1 = Mock() + mock_ingredient2 = Mock() + + # Настраиваем возвращаемые значения + mock_bun.get_price.return_value = 100.0 # Булочка стоит 100 + mock_ingredient1.get_price.return_value = 50.0 # Ингредиент 1 + mock_ingredient2.get_price.return_value = 30.0 # Ингредиент 2 + + # Act + burger.set_buns(mock_bun) + burger.add_ingredient(mock_ingredient1) + burger.add_ingredient(mock_ingredient2) + total_price = burger.get_price() + + # Assert + # Ожидаемая цена: (100 * 2) + 50 + 30 = 280 + expected_price = 280.0 + assert total_price == expected_price + + # Проверяем, что методы были вызваны + assert mock_bun.get_price.call_count == 1 + assert mock_ingredient1.get_price.call_count == 1 + assert mock_ingredient2.get_price.call_count == 1 + + @pytest.mark.parametrize("bun_price,ingredient_prices,expected_total", [ + (100.0, [50.0, 30.0], 280.0), # (100*2) + 50 + 30 + (150.0, [75.0, 45.0, 60.0], 480.0), # (150*2) + 75 + 45 + 60 + (80.0, [], 160.0), # Только булочки + ]) + def test_get_price_parametrized(self, bun_price, ingredient_prices, expected_total): + """Параметризованный тест расчета цены с разными значениями""" + # Arrange + burger = Burger() + + mock_bun = Mock() + mock_bun.get_price.return_value = bun_price + + mock_ingredients = [] + for price in ingredient_prices: + mock_ingr = Mock() + mock_ingr.get_price.return_value = price + mock_ingredients.append(mock_ingr) + + # Act + burger.set_buns(mock_bun) + for ingredient in mock_ingredients: + burger.add_ingredient(ingredient) + + total_price = burger.get_price() + + # Assert + assert total_price == expected_total + + def test_get_receipt_with_real_objects(self): + """Тест формирования чека с реальными объектами""" + # Arrange + burger = Burger() + + bun = Bun("Черная булочка", 100.0) + ingredient1 = Ingredient(INGREDIENT_TYPE_SAUCE, "горчичный соус", 50.0) + ingredient2 = Ingredient(INGREDIENT_TYPE_FILLING, "котлета", 100.0) + + # Act + burger.set_buns(bun) + burger.add_ingredient(ingredient1) + burger.add_ingredient(ingredient2) + receipt = burger.get_receipt() + + # Assert + assert "(==== Черная булочка ====)" in receipt + assert "= sauce горчичный соус =" in receipt + assert "= filling котлета =" in receipt + assert "Price: 350.0" in receipt # (100*2) + 50 + 100 = 350 + + def test_get_receipt_with_mocks(self): + """Тест формирования чека с использованием моков""" + # Arrange + burger = Burger() + + mock_bun = Mock() + mock_bun.get_name.return_value = "Тестовая булочка" + mock_bun.get_price.return_value = 120.0 + + mock_ingredient1 = Mock() + mock_ingredient1.get_type.return_value = "SAUCE" + mock_ingredient1.get_name.return_value = "кетчуп" + mock_ingredient1.get_price.return_value = 40.0 + + mock_ingredient2 = Mock() + mock_ingredient2.get_type.return_value = "FILLING" + mock_ingredient2.get_name.return_value = "салат" + mock_ingredient2.get_price.return_value = 30.0 + + # Act + burger.set_buns(mock_bun) + burger.add_ingredient(mock_ingredient1) + burger.add_ingredient(mock_ingredient2) + receipt = burger.get_receipt() + + # Assert + expected_lines = [ + "(==== Тестовая булочка ====)", + "= sauce кетчуп =", + "= filling салат =", + "(==== Тестовая булочка ====)", + "Price: 310.0" # (120*2) + 40 + 30 = 310 + ] + + for line in expected_lines: + assert line in receipt + + def test_remove_ingredient_invalid_index(self): + """Тест попытки удаления ингредиента с неверным индексом""" + # Arrange + burger = Burger() + mock_ingredient = Mock() + burger.add_ingredient(mock_ingredient) + + # Act & Assert + with pytest.raises(IndexError): + burger.remove_ingredient(5) # Неверный индекс + + def test_move_ingredient_invalid_index(self): + """Тест попытки перемещения ингредиента с неверным индексом""" + # Arrange + burger = Burger() + mock_ingredient = Mock() + burger.add_ingredient(mock_ingredient) + + # Act & Assert + with pytest.raises(IndexError): + burger.move_ingredient(5, 0) # Неверный исходный индекс From c180d9ed76cd7cfcde207d0d5e8ac53c3cdae1da Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:30:07 +0100 Subject: [PATCH 08/54] Create test_database.py --- tests/test_database.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_database.py diff --git a/tests/test_database.py b/tests/test_database.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/test_database.py @@ -0,0 +1 @@ + From fbb2cd322c01980fcc13e315b47f35290145e8ae Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:30:26 +0100 Subject: [PATCH 09/54] Add tests for Database class methods Added tests for Database class methods including initialization, available buns, ingredients, bun prices, and ingredient names. --- tests/test_database.py | 98 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/tests/test_database.py b/tests/test_database.py index 8b1378917..27598d62a 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1 +1,99 @@ +""" +Тесты для класса Database из database.py +""" +import pytest +from praktikum.database import Database +from praktikum.bun import Bun +from praktikum.ingredient import Ingredient +from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING + +class TestDatabase: + """Тестирование базы данных""" + + def test_database_initialization(self): + """Проверка инициализации базы данных""" + # Arrange & Act + database = Database() + + # Assert + # Проверяем количество булочек + assert len(database.buns) == 3 + # Проверяем количество ингредиентов (3 соуса + 3 начинки) + assert len(database.ingredients) == 6 + + def test_available_buns(self): + """Проверка получения списка доступных булочек""" + # Arrange + database = Database() + + # Act + buns = database.available_buns() + + # Assert + assert isinstance(buns, list) + assert len(buns) == 3 + + # Проверяем, что все элементы - объекты Bun + for bun in buns: + assert isinstance(bun, Bun) + + # Проверяем названия булочек + bun_names = [bun.get_name() for bun in buns] + assert "black bun" in bun_names + assert "white bun" in bun_names + assert "red bun" in bun_names + + def test_available_ingredients(self): + """Проверка получения списка доступных ингредиентов""" + # Arrange + database = Database() + + # Act + ingredients = database.available_ingredients() + + # Assert + assert isinstance(ingredients, list) + assert len(ingredients) == 6 + + # Проверяем, что все элементы - объекты Ingredient + for ingredient in ingredients: + assert isinstance(ingredient, Ingredient) + + # Проверяем типы ингредиентов + ingredient_types = [ingredient.get_type() for ingredient in ingredients] + assert ingredient_types.count(INGREDIENT_TYPE_SAUCE) == 3 + assert ingredient_types.count(INGREDIENT_TYPE_FILLING) == 3 + + def test_bun_prices(self): + """Проверка цен булочек в базе данных""" + # Arrange + database = Database() + + # Act + buns = database.available_buns() + + # Assert + prices = [bun.get_price() for bun in buns] + assert 100.0 in prices # black bun + assert 200.0 in prices # white bun + assert 300.0 in prices # red bun + + def test_ingredient_names(self): + """Проверка названий ингредиентов в базе данных""" + # Arrange + database = Database() + + # Act + ingredients = database.available_ingredients() + ingredient_names = [ingredient.get_name() for ingredient in ingredients] + + # Assert для соусов + assert "hot sauce" in ingredient_names + assert "sour cream" in ingredient_names + assert "chili sauce" in ingredient_names + + # Assert для начинок + assert "cutlet" in ingredient_names + assert "dinosaur" in ingredient_names + assert "sausage" in ingredient_names From ec553102c002fb1b1603059a4ccbcbff6c6809d0 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:30:57 +0100 Subject: [PATCH 10/54] Create __init__.py --- tests/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ + From 625e69c63cda3179895abd655732c8851ceba76a Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:31:20 +0100 Subject: [PATCH 11/54] Create conftest.py --- tests/conftest.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1 @@ + From 19b911250b785f763caa8df241bab115a7c3b742 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:31:38 +0100 Subject: [PATCH 12/54] Add test fixtures for bun and ingredients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены фикстуры для тестирования булочек и ингредиентов. --- tests/conftest.py | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 8b1378917..0d669c0df 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1 +1,49 @@ +""" +Общие фикстуры для тестов +""" +import pytest +from unittest.mock import Mock +from praktikum.bun import Bun +from praktikum.ingredient import Ingredient +from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING + + +@pytest.fixture +def mock_bun(): + """Фикстура для создания мока булочки""" + bun = Mock(spec=Bun) + bun.get_name.return_value = "Тестовая булочка" + bun.get_price.return_value = 100.0 + return bun + + +@pytest.fixture +def mock_sauce_ingredient(): + """Фикстура для создания мока соуса""" + ingredient = Mock(spec=Ingredient) + ingredient.get_type.return_value = INGREDIENT_TYPE_SAUCE + ingredient.get_name.return_value = "кетчуп" + ingredient.get_price.return_value = 50.0 + return ingredient + + +@pytest.fixture +def mock_filling_ingredient(): + """Фикстура для создания мока начинки""" + ingredient = Mock(spec=Ingredient) + ingredient.get_type.return_value = INGREDIENT_TYPE_FILLING + ingredient.get_name.return_value = "котлета" + ingredient.get_price.return_value = 100.0 + return ingredient + + +@pytest.fixture +def burger_with_ingredients(mock_bun, mock_sauce_ingredient, mock_filling_ingredient): + """Фикстура для создания бургера с ингредиентами""" + from praktikum.burger import Burger + burger = Burger() + burger.set_buns(mock_bun) + burger.add_ingredient(mock_sauce_ingredient) + burger.add_ingredient(mock_filling_ingredient) + return burger From 04bb73a688bf8425f8452d0a5203613bf99b258b Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:32:18 +0100 Subject: [PATCH 13/54] Create requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ + From b57457df71204fd31b9e0de286807a5ef8ae2be7 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:32:36 +0100 Subject: [PATCH 14/54] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8b1378917..e175fdfb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ - +pytest>=7.0.0 +pytest-mock>=3.10.0 From 2f4dd68e2787ad85ccb2b767ec19edebedfaad5b Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:18:58 +0100 Subject: [PATCH 15/54] Create .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ + From e6e15985e4b9730c531549a15740132a44bb962c Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:19:19 +0100 Subject: [PATCH 16/54] Add comprehensive Python and environment ignores --- .gitignore | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/.gitignore b/.gitignore index 8b1378917..0c6be453f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,69 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +# Virtual Environments +venv/ +env/ +ENV/ +env.bak/ +venv.bak/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# Testing +.coverage +htmlcov/ +.pytest_cache/ +.tox/ +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Output +*.log +*.sqlite3 + +# OS +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Project specific +reports/ +*.report +test_output/ From 07be91e4725b843b13d9d9643ae411b2c645d786 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:23:45 +0100 Subject: [PATCH 17/54] Create __init__.py --- praktikum/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/__init__.py diff --git a/praktikum/__init__.py b/praktikum/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/__init__.py @@ -0,0 +1 @@ + From f67611d67ed4b2c10e74a57c8bd7f0b4d0f15ca1 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:24:13 +0100 Subject: [PATCH 18/54] Create bun.py --- praktikum/bun.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/bun.py diff --git a/praktikum/bun.py b/praktikum/bun.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/bun.py @@ -0,0 +1 @@ + From c8902981081bf828d0ef56938e03458f60ed3703 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:24:37 +0100 Subject: [PATCH 19/54] Add Bun class for burger model with name and price --- praktikum/bun.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/praktikum/bun.py b/praktikum/bun.py index 8b1378917..5504bc1f4 100644 --- a/praktikum/bun.py +++ b/praktikum/bun.py @@ -1 +1,15 @@ +class Bun: + """ + Модель булочки для бургера. + Булочке можно дать название и назначить цену. + """ + def __init__(self, name: str, price: float): + self.name = name + self.price = price + + def get_name(self) -> str: + return self.name + + def get_price(self) -> float: + return self.price From a34cb98d02ebd044b43c12faf30590eb3cc20478 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:25:10 +0100 Subject: [PATCH 20/54] Create ingredient_types.py --- praktikum/ingredient_types.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/ingredient_types.py diff --git a/praktikum/ingredient_types.py b/praktikum/ingredient_types.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/ingredient_types.py @@ -0,0 +1 @@ + From 1c1b2fdd95bcd521b8b0f504a42d04e929ab9c15 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:25:34 +0100 Subject: [PATCH 21/54] Define ingredient types enumeration Added an enumeration for ingredient types with descriptions. --- praktikum/ingredient_types.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/praktikum/ingredient_types.py b/praktikum/ingredient_types.py index 8b1378917..34940ad5d 100644 --- a/praktikum/ingredient_types.py +++ b/praktikum/ingredient_types.py @@ -1 +1,7 @@ - +""" +Перечисление с типами ингредиентов. +SAUCE – соус +FILLING – начинка +""" +INGREDIENT_TYPE_SAUCE = 'SAUCE' +INGREDIENT_TYPE_FILLING = 'FILLING' From 727195f49a3c7fe1fa0c9e68069c7473288a15dc Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:25:59 +0100 Subject: [PATCH 22/54] Create ingredient.py --- praktikum/ingredient.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/ingredient.py diff --git a/praktikum/ingredient.py b/praktikum/ingredient.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/ingredient.py @@ -0,0 +1 @@ + From 725b8037e4482b970d83b887725e6b2573fcb4fc Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:26:17 +0100 Subject: [PATCH 23/54] Add Ingredient class with properties and methods --- praktikum/ingredient.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/praktikum/ingredient.py b/praktikum/ingredient.py index 8b1378917..0e50db8a2 100644 --- a/praktikum/ingredient.py +++ b/praktikum/ingredient.py @@ -1 +1,20 @@ +class Ingredient: + """ + Модель ингредиента. + Ингредиент: начинка или соус. + У ингредиента есть тип (начинка или соус), название и цена. + """ + def __init__(self, ingredient_type: str, name: str, price: float): + self.type = ingredient_type + self.name = name + self.price = price + + def get_price(self) -> float: + return self.price + + def get_name(self) -> str: + return self.name + + def get_type(self) -> str: + return self.type From 030c3119996dd16edc6961f639f5ddc13104983d Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:26:42 +0100 Subject: [PATCH 24/54] Create burger.py --- praktikum/burger.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/burger.py diff --git a/praktikum/burger.py b/praktikum/burger.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/burger.py @@ -0,0 +1 @@ + From cd9ac290d7859633beb19049f8ac7fe5dbf2e4f4 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:27:03 +0100 Subject: [PATCH 25/54] Add Burger class with ingredient management Implemented Burger class with methods to manage buns and ingredients. --- praktikum/burger.py | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/praktikum/burger.py b/praktikum/burger.py index 8b1378917..2b3b6a88b 100644 --- a/praktikum/burger.py +++ b/praktikum/burger.py @@ -1 +1,48 @@ +from typing import List +from praktikum.bun import Bun +from praktikum.ingredient import Ingredient + + +class Burger: + """ + Модель бургера. + Бургер состоит из булочек и ингредиентов (начинка или соус). + Ингредиенты можно перемещать и удалять. + Можно распечать чек с информацией о бургере. + """ + + def __init__(self): + self.bun = None + self.ingredients: List[Ingredient] = [] + + def set_buns(self, bun: Bun): + self.bun = bun + + def add_ingredient(self, ingredient: Ingredient): + self.ingredients.append(ingredient) + + def remove_ingredient(self, index: int): + del self.ingredients[index] + + def move_ingredient(self, index: int, new_index: int): + self.ingredients.insert(new_index, self.ingredients.pop(index)) + + def get_price(self) -> float: + price = self.bun.get_price() * 2 + + for ingredient in self.ingredients: + price += ingredient.get_price() + + return price + + def get_receipt(self) -> str: + receipt: List[str] = [f'(==== {self.bun.get_name()} ====)'] + + for ingredient in self.ingredients: + receipt.append(f'= {str(ingredient.get_type()).lower()} {ingredient.get_name()} =') + + receipt.append(f'(==== {self.bun.get_name()} ====)\n') + receipt.append(f'Price: {self.get_price()}') + + return '\n'.join(receipt) From 45c2dac72f5f2356ea2533272f2e9bcb65233fbb Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:27:26 +0100 Subject: [PATCH 26/54] Create database.py --- praktikum/database.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/database.py diff --git a/praktikum/database.py b/praktikum/database.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/database.py @@ -0,0 +1 @@ + From b279cc42d294156505da3840e21069ce17562a84 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:27:45 +0100 Subject: [PATCH 27/54] Add Database class with buns and ingredients Initialize database with predefined buns and ingredients. --- praktikum/database.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/praktikum/database.py b/praktikum/database.py index 8b1378917..4c75baf71 100644 --- a/praktikum/database.py +++ b/praktikum/database.py @@ -1 +1,33 @@ +from typing import List +from praktikum.bun import Bun +from praktikum.ingredient import Ingredient +from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING + + +class Database: + """ + Класс с методами по работе с базой данных. + """ + + def __init__(self): + self.buns: List[Bun] = [] + self.ingredients: List[Ingredient] = [] + + self.buns.append(Bun("black bun", 100)) + self.buns.append(Bun("white bun", 200)) + self.buns.append(Bun("red bun", 300)) + + self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 100)) + self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "sour cream", 200)) + self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "chili sauce", 300)) + + self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "cutlet", 100)) + self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "dinosaur", 200)) + self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "sausage", 300)) + + def available_buns(self) -> List[Bun]: + return self.buns + + def available_ingredients(self) -> List[Ingredient]: + return self.ingredients From 8d522e39b50ca6b9af4061bdfd3c4be5d364b747 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:30:26 +0100 Subject: [PATCH 28/54] Delete bun.py --- bun.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 bun.py diff --git a/bun.py b/bun.py deleted file mode 100644 index f8923b57c..000000000 --- a/bun.py +++ /dev/null @@ -1,33 +0,0 @@ -# class Bun: - # """ - # Модель булочки для бургера. - # Булочке можно дать название и назначить цену. - # """ -# - # def __init__(self, name: str, price: float): - # self.name = name - # self.price = price - - #def get_name(self) -> str: - # return self.name - - #def get_price(self) -> float: - #return self.price - -#import pytest -#from praktikum.bun import Bun - - -class TestBun: - def test_bun_creation(self): - bun = Bun("Wheat Bun", 100.0) - assert bun.name == "Wheat Bun" - assert bun.price == 100.0 - - def test_get_name(self): - bun = Bun("Rye Bun", 120.0) - assert bun.get_name() == "Rye Bun" - - def test_get_price(self): - bun = Bun("Sesame Bun", 80.0) - assert bun.get_price() == 80.0 From 67dc3b0a3218cfc5cadd9c822c0ce4d458b9d951 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:30:47 +0100 Subject: [PATCH 29/54] Delete burger.py --- burger.py | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 burger.py diff --git a/burger.py b/burger.py deleted file mode 100644 index 2b3b6a88b..000000000 --- a/burger.py +++ /dev/null @@ -1,48 +0,0 @@ -from typing import List - -from praktikum.bun import Bun -from praktikum.ingredient import Ingredient - - -class Burger: - """ - Модель бургера. - Бургер состоит из булочек и ингредиентов (начинка или соус). - Ингредиенты можно перемещать и удалять. - Можно распечать чек с информацией о бургере. - """ - - def __init__(self): - self.bun = None - self.ingredients: List[Ingredient] = [] - - def set_buns(self, bun: Bun): - self.bun = bun - - def add_ingredient(self, ingredient: Ingredient): - self.ingredients.append(ingredient) - - def remove_ingredient(self, index: int): - del self.ingredients[index] - - def move_ingredient(self, index: int, new_index: int): - self.ingredients.insert(new_index, self.ingredients.pop(index)) - - def get_price(self) -> float: - price = self.bun.get_price() * 2 - - for ingredient in self.ingredients: - price += ingredient.get_price() - - return price - - def get_receipt(self) -> str: - receipt: List[str] = [f'(==== {self.bun.get_name()} ====)'] - - for ingredient in self.ingredients: - receipt.append(f'= {str(ingredient.get_type()).lower()} {ingredient.get_name()} =') - - receipt.append(f'(==== {self.bun.get_name()} ====)\n') - receipt.append(f'Price: {self.get_price()}') - - return '\n'.join(receipt) From ff76c73d0f3b90a354a7cc047bdb7d7f92a30800 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:31:06 +0100 Subject: [PATCH 30/54] Delete database.py --- database.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 database.py diff --git a/database.py b/database.py deleted file mode 100644 index 4c75baf71..000000000 --- a/database.py +++ /dev/null @@ -1,33 +0,0 @@ -from typing import List - -from praktikum.bun import Bun -from praktikum.ingredient import Ingredient -from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING - - -class Database: - """ - Класс с методами по работе с базой данных. - """ - - def __init__(self): - self.buns: List[Bun] = [] - self.ingredients: List[Ingredient] = [] - - self.buns.append(Bun("black bun", 100)) - self.buns.append(Bun("white bun", 200)) - self.buns.append(Bun("red bun", 300)) - - self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 100)) - self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "sour cream", 200)) - self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "chili sauce", 300)) - - self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "cutlet", 100)) - self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "dinosaur", 200)) - self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "sausage", 300)) - - def available_buns(self) -> List[Bun]: - return self.buns - - def available_ingredients(self) -> List[Ingredient]: - return self.ingredients From b00d1359ee47314c1d1b774e338bfb683c41292d Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:31:27 +0100 Subject: [PATCH 31/54] Delete ingredient.py --- ingredient.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 ingredient.py diff --git a/ingredient.py b/ingredient.py deleted file mode 100644 index 0e50db8a2..000000000 --- a/ingredient.py +++ /dev/null @@ -1,20 +0,0 @@ -class Ingredient: - """ - Модель ингредиента. - Ингредиент: начинка или соус. - У ингредиента есть тип (начинка или соус), название и цена. - """ - - def __init__(self, ingredient_type: str, name: str, price: float): - self.type = ingredient_type - self.name = name - self.price = price - - def get_price(self) -> float: - return self.price - - def get_name(self) -> str: - return self.name - - def get_type(self) -> str: - return self.type From 76e44abe75ccff657d8c69da52d6d8e77468d2d4 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:31:48 +0100 Subject: [PATCH 32/54] Delete ingredient_types.py --- ingredient_types.py | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 ingredient_types.py diff --git a/ingredient_types.py b/ingredient_types.py deleted file mode 100644 index 34940ad5d..000000000 --- a/ingredient_types.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Перечисление с типами ингредиентов. -SAUCE – соус -FILLING – начинка -""" -INGREDIENT_TYPE_SAUCE = 'SAUCE' -INGREDIENT_TYPE_FILLING = 'FILLING' From a7dba884dfc49834d5c1635c564103ea6b291e0b Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:34:19 +0100 Subject: [PATCH 33/54] Create praktikum.py --- praktikum/praktikum.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 praktikum/praktikum.py diff --git a/praktikum/praktikum.py b/praktikum/praktikum.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/praktikum/praktikum.py @@ -0,0 +1 @@ + From 674f6a334640e02cb73511dfc6bf984831490ff4 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:34:36 +0100 Subject: [PATCH 34/54] Implement burger creation and manipulation logic --- praktikum/praktikum.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/praktikum/praktikum.py b/praktikum/praktikum.py index 8b1378917..b68ae65e3 100644 --- a/praktikum/praktikum.py +++ b/praktikum/praktikum.py @@ -1 +1,42 @@ +from typing import List + +from praktikum.bun import Bun +from praktikum.burger import Burger +from praktikum.database import Database +from praktikum.ingredient import Ingredient + + +def main(): + # Инициализируем базу данных + database: Database = Database() + + # Создадим новый бургер + burger: Burger = Burger() + + # Считаем список доступных булок из базы данных + buns: List[Bun] = database.available_buns() + + # Считаем список доступных ингредиентов из базы данных + ingredients: List[Ingredient] = database.available_ingredients() + + # Соберём бургер + burger.set_buns(buns[0]) + + burger.add_ingredient(ingredients[1]) + burger.add_ingredient(ingredients[4]) + burger.add_ingredient(ingredients[3]) + burger.add_ingredient(ingredients[5]) + + # Переместим слой с ингредиентом + burger.move_ingredient(2, 1) + + # Удалим ингредиент + burger.remove_ingredient(3) + + # Распечатаем рецепт бургера + print(burger.get_receipt()) + + +if __name__ == "__main__": + main() From f587f073372d4ccc1c7fffafa2a8f840447a157a Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:34:53 +0100 Subject: [PATCH 35/54] Delete praktikum.py --- praktikum.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 praktikum.py diff --git a/praktikum.py b/praktikum.py deleted file mode 100644 index ec522fa6d..000000000 --- a/praktikum.py +++ /dev/null @@ -1,41 +0,0 @@ -from typing import List - -from praktikum.bun import Bun -from praktikum.burger import Burger -from praktikum.database import Database -from praktikum.ingredient import Ingredient - - -def main(): - # Инициализируем базу данных - database: Database = Database() - - # Создадим новый бургер - burger: Burger = Burger() - - # Считаем список доступных булок из базы данных - buns: List[Bun] = database.available_buns() - - # Считаем список доступных ингредиентов из базы данных - ingredients: List[Ingredient] = database.available_ingredients() - - # Соберём бургер - burger.set_buns(buns[0]) - - burger.add_ingredient(ingredients[1]) - burger.add_ingredient(ingredients[4]) - burger.add_ingredient(ingredients[3]) - burger.add_ingredient(ingredients[5]) - - # Переместим слой с ингредиентом - burger.move_ingredient(2, 1) - - # Удалим ингредиент - burger.remove_ingredient(3) - - # Распечатаем рецепт бургера - print(burger.get_receipt()) - - -if __name__ == "__main__": - main() From ed2cb192265cbbeab7d505f2e1c12371f6af8969 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:35:52 +0100 Subject: [PATCH 36/54] Create test_praktikum.py --- tests/test_praktikum.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test_praktikum.py diff --git a/tests/test_praktikum.py b/tests/test_praktikum.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/tests/test_praktikum.py @@ -0,0 +1 @@ + From ee339a8ffea6e3c74b40db7afc746bae025bf908 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:36:12 +0100 Subject: [PATCH 37/54] Update test_praktikum.py --- tests/test_praktikum.py | 207 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) diff --git a/tests/test_praktikum.py b/tests/test_praktikum.py index 8b1378917..362966864 100644 --- a/tests/test_praktikum.py +++ b/tests/test_praktikum.py @@ -1 +1,208 @@ +""" +Тесты для главного модуля praktikum.py +""" +import pytest +from unittest.mock import Mock, patch, call +from praktikum.praktikum import main + +class TestPraktikum: + """Тестирование основного модуля программы""" + + @patch('praktikum.praktikum.print') # Мокаем print + @patch('praktikum.praktikum.Database') # Мокаем Database + def test_main_function_creates_burger_correctly(self, mock_database_class, mock_print): + """ + Тестирует, что функция main() правильно создает бургер: + 1. Создает базу данных + 2. Берет нужные булочки и ингредиенты + 3. Добавляет ингредиенты в правильном порядке + 4. Перемещает и удаляет ингредиенты + 5. Выводит правильный чек + """ + # ===== ARRANGE ===== + # Создаем мок для экземпляра Database + mock_database_instance = Mock() + mock_database_class.return_value = mock_database_instance + + # Создаем моки для булочек + mock_buns = [Mock() for _ in range(3)] + mock_buns[0].get_name.return_value = "black bun" + mock_buns[0].get_price.return_value = 100.0 + + # Создаем моки для ингредиентов (6 штук) + mock_ingredients = [Mock() for _ in range(6)] + + # Настраиваем возвращаемые значения для ингредиентов + # Соусы (первые 3) + mock_ingredients[0].get_type.return_value = "SAUCE" + mock_ingredients[0].get_name.return_value = "hot sauce" + mock_ingredients[0].get_price.return_value = 100.0 + + mock_ingredients[1].get_type.return_value = "SAUCE" + mock_ingredients[1].get_name.return_value = "sour cream" + mock_ingredients[1].get_price.return_value = 200.0 + + mock_ingredients[2].get_type.return_value = "SAUCE" + mock_ingredients[2].get_name.return_value = "chili sauce" + mock_ingredients[2].get_price.return_value = 300.0 + + # Начинки (последние 3) + mock_ingredients[3].get_type.return_value = "FILLING" + mock_ingredients[3].get_name.return_value = "cutlet" + mock_ingredients[3].get_price.return_value = 100.0 + + mock_ingredients[4].get_type.return_value = "FILLING" + mock_ingredients[4].get_name.return_value = "dinosaur" + mock_ingredients[4].get_price.return_value = 200.0 + + mock_ingredients[5].get_type.return_value = "FILLING" + mock_ingredients[5].get_name.return_value = "sausage" + mock_ingredients[5].get_price.return_value = 300.0 + + # Настраиваем методы базы данных + mock_database_instance.available_buns.return_value = mock_buns + mock_database_instance.available_ingredients.return_value = mock_ingredients + + # ===== ACT ===== + # Вызываем тестируемую функцию + main() + + # ===== ASSERT ===== + # 1. Проверяем создание Database + mock_database_class.assert_called_once() + + # 2. Проверяем вызовы методов базы данных + mock_database_instance.available_buns.assert_called_once() + mock_database_instance.available_ingredients.assert_called_once() + + # 3. Проверяем, что print был вызван + mock_print.assert_called_once() + + # 4. Получаем аргумент, с которым был вызван print + printed_receipt = mock_print.call_args[0][0] + + # 5. Проверяем содержимое чека + assert "(==== black bun ====)" in printed_receipt + assert "Price:" in printed_receipt + + @patch('praktikum.praktikum.print') + @patch('praktikum.praktikum.Database') + def test_main_uses_correct_indices_from_database(self, mock_database_class, mock_print): + """ + Проверяем, что main() использует правильные индексы из базы данных: + - buns[0] - первая булочка + - ingredients[1], [4], [3], [5] - конкретные ингредиенты + """ + # ===== ARRANGE ===== + mock_database_instance = Mock() + mock_database_class.return_value = mock_database_instance + + # Создаем отслеживаемые моки + mock_buns = [Mock() for _ in range(3)] + mock_ingredients = [Mock() for _ in range(6)] + + # Создаем мок для Burger, чтобы отслеживать вызовы + with patch('praktikum.praktikum.Burger') as mock_burger_class: + mock_burger_instance = Mock() + mock_burger_class.return_value = mock_burger_instance + + mock_database_instance.available_buns.return_value = mock_buns + mock_database_instance.available_ingredients.return_value = mock_ingredients + + # ===== ACT ===== + main() + + # ===== ASSERT ===== + # Проверяем вызовы методов Burger с правильными аргументами + mock_burger_instance.set_buns.assert_called_once_with(mock_buns[0]) + + # Проверяем добавление ингредиентов в правильном порядке + expected_add_calls = [ + call(mock_ingredients[1]), + call(mock_ingredients[4]), + call(mock_ingredients[3]), + call(mock_ingredients[5]) + ] + mock_burger_instance.add_ingredient.assert_has_calls(expected_add_calls) + + # Проверяем перемещение ингредиента + mock_burger_instance.move_ingredient.assert_called_once_with(2, 1) + + # Проверяем удаление ингредиента + mock_burger_instance.remove_ingredient.assert_called_once_with(3) + + # Проверяем вывод чека + mock_burger_instance.get_receipt.assert_called_once() + mock_print.assert_called_once_with(mock_burger_instance.get_receipt.return_value) + + @patch('praktikum.praktikum.print') + @patch('praktikum.praktikum.Database') + def test_main_handles_empty_database(self, mock_database_class, mock_print): + """ + Тестируем обработку пустой базы данных + """ + # ===== ARRANGE ===== + mock_database_instance = Mock() + mock_database_class.return_value = mock_database_instance + + # Пустые списки + mock_database_instance.available_buns.return_value = [] + mock_database_instance.available_ingredients.return_value = [] + + # ===== ACT & ASSERT ===== + # Должно вызвать IndexError при попытке обращения по индексу + with pytest.raises(IndexError): + main() + + def test_main_can_be_imported(self): + """ + Проверяем, что модуль можно импортировать без ошибок + """ + # Эта проверка гарантирует, что синтаксис модуля корректен + from praktikum.praktikum import main + assert callable(main) + + @patch('praktikum.praktikum.print') + @patch('praktikum.praktikum.Database') + def test_main_price_calculation_integration(self, mock_database_class, mock_print): + """ + Интеграционный тест: проверяем правильность расчета цены + """ + # ===== ARRANGE ===== + mock_database_instance = Mock() + mock_database_class.return_value = mock_database_instance + + # Настраиваем цены согласно коду из database.py + mock_buns = [Mock()] + mock_buns[0].get_name.return_value = "black bun" + mock_buns[0].get_price.return_value = 100.0 # black bun цена 100 + + # Создаем 6 ингредиентов как в database.py + mock_ingredients = [Mock() for _ in range(6)] + + # Соусы (индексы 0, 1, 2) + mock_ingredients[0].get_price.return_value = 100.0 # hot sauce + mock_ingredients[1].get_price.return_value = 200.0 # sour cream + mock_ingredients[2].get_price.return_value = 300.0 # chili sauce + + # Начинки (индексы 3, 4, 5) + mock_ingredients[3].get_price.return_value = 100.0 # cutlet + mock_ingredients[4].get_price.return_value = 200.0 # dinosaur + mock_ingredients[5].get_price.return_value = 300.0 # sausage + + mock_database_instance.available_buns.return_value = mock_buns + mock_database_instance.available_ingredients.return_value = mock_ingredients + + # ===== ACT ===== + main() + + # ===== ASSERT ===== + # main() добавляет: ingredients[1], [4], [3], [5] + # Цены: sour cream(200) + dinosaur(200) + cutlet(100) + sausage(300) = 800 + # Плюс булочка black bun: 100 * 2 = 200 + # Итого: 200 + 800 = 1000 + + # Проверяем, что в чеке есть правильная цена + printed_receipt = mock_print.call_args[0][0] + assert "Price: 1000" in printed_receipt From ea4c14ea62a7a42fe6bd6acd4216825590b92001 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:37:18 +0100 Subject: [PATCH 38/54] Create mock_database fixture for tests Added a mock database fixture for testing purposes. --- tests/conftest.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 0d669c0df..c8a763eab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -47,3 +47,34 @@ def burger_with_ingredients(mock_bun, mock_sauce_ingredient, mock_filling_ingred burger.add_ingredient(mock_sauce_ingredient) burger.add_ingredient(mock_filling_ingredient) return burger + + + +# ... существующий код ... + +@pytest.fixture +def mock_database(): + """Фикстура для создания мока базы данных""" + database = Mock() + + # Создаем моки для булочек + mock_buns = [Mock(), Mock(), Mock()] + mock_buns[0].get_name.return_value = "black bun" + mock_buns[0].get_price.return_value = 100.0 + + # Создаем моки для ингредиентов + mock_ingredients = [Mock() for _ in range(6)] + + # Настраиваем ингредиенты + for i in range(3): # Соусы + mock_ingredients[i].get_type.return_value = "SAUCE" + mock_ingredients[i].get_price.return_value = (i + 1) * 100.0 + + for i in range(3, 6): # Начинки + mock_ingredients[i].get_type.return_value = "FILLING" + mock_ingredients[i].get_price.return_value = (i - 2) * 100.0 + + database.available_buns.return_value = mock_buns + database.available_ingredients.return_value = mock_ingredients + + return database From bc2d0b634697bf7fdb877ea9c422f8013d752c90 Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Wed, 24 Dec 2025 20:34:16 +0100 Subject: [PATCH 39/54] Complete unit test suite for Stellar Burgers - Remove redundant __init__.py from root - Update .gitignore with proper patterns - Update dependencies in requirements.txt - Fix test encoding issues (convert to English) - Correct price calculation in integration test - All 36 tests now passing successfully --- .gitignore | 2 +- __init__.py | 0 requirements.txt | Bin 34 -> 1250 bytes tests/test_bun.py | 47 +++++++++++++----------------------- tests/test_ingredient.py | 51 +++++++++++++++------------------------ tests/test_praktikum.py | 2 +- 6 files changed, 39 insertions(+), 63 deletions(-) delete mode 100644 __init__.py diff --git a/.gitignore b/.gitignore index 0c6be453f..47b950589 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ venv.bak/ # Testing .coverage -htmlcov/ + .pytest_cache/ .tox/ .coverage.* diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/requirements.txt b/requirements.txt index e175fdfb8ef9f707c3398997e6c1ba09577cd712..5da4807ada3770c0104ffe604620accd89eaf70e 100644 GIT binary patch literal 1250 zcmZ`(%TB{U5Sud+pOUIc%Imilv*6#ZxTL=7eC6N1X3y3*EANd6^w66mP$ZR4tgy*od7bDUt`#lTl% z0z?*$C4!tpoR5f|pDt{LcOouOP4UFuH#q%t)Zxl2vAT9_WKO{wE5R!0ES!_N$jMs< z{5SYaw|?7|Bj^WFa-)WC{V;c_q8`;}@UnIvg>BHIghJkc+>vkcw(%USP&s%na!op! zj1ru2zU`F2UZ99`i<=MK)sYpo>bB5q8lm$?-FPm#ESQoj$HAZ#!4P z^HU0him9y7jfvixuG~PhkD!+%eC-MDa+POta jkZv3u{(T?%%pOV=b Date: Wed, 24 Dec 2025 20:46:24 +0100 Subject: [PATCH 40/54] fix: Update .gitignore with htmlcov and remove duplicates --- .gitignore | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 47b950589..cc04c318f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ + # Python __pycache__/ *.py[cod] @@ -38,7 +39,7 @@ venv.bak/ # Testing .coverage - +htmlcov/ .pytest_cache/ .tox/ .coverage.* @@ -48,7 +49,11 @@ coverage.xml *.cover *.py,cover .hypothesis/ -.pytest_cache/ + + + +allure-results/ +allure-report/ # Output *.log @@ -66,4 +71,4 @@ Thumbs.db # Project specific reports/ *.report -test_output/ +test_output/ \ No newline at end of file From 20925a835cb86bd77c66081dbd8f939b87c74dcc Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Wed, 24 Dec 2025 21:06:47 +0100 Subject: [PATCH 41/54] Remove htmlcov directory from .gitignore Remove 'htmlcov/' from the .gitignore file. --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cc04c318f..1bcc4243f 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,7 @@ venv.bak/ # Testing .coverage -htmlcov/ + .pytest_cache/ .tox/ .coverage.* @@ -71,4 +71,4 @@ Thumbs.db # Project specific reports/ *.report -test_output/ \ No newline at end of file +test_output/ From 71168412e142cd707f18bc40288f3e1568d015be Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Wed, 24 Dec 2025 21:19:36 +0100 Subject: [PATCH 42/54] Add coverage reports --- htmlcov/.gitignore | 2 + htmlcov/class_index.html | 195 +++++ htmlcov/coverage_html_cb_497bf287.js | 733 ++++++++++++++++++ htmlcov/favicon_32_cb_58284776.png | Bin 0 -> 1732 bytes htmlcov/function_index.html | 307 ++++++++ htmlcov/index.html | 153 ++++ htmlcov/keybd_closed_cb_ce680311.png | Bin 0 -> 9004 bytes htmlcov/status.json | 1 + htmlcov/style_cb_dca529e9.css | 377 +++++++++ htmlcov/z_c68eb0c7512457e4___init___py.html | 98 +++ htmlcov/z_c68eb0c7512457e4_bun_py.html | 112 +++ htmlcov/z_c68eb0c7512457e4_burger_py.html | 145 ++++ htmlcov/z_c68eb0c7512457e4_database_py.html | 130 ++++ htmlcov/z_c68eb0c7512457e4_ingredient_py.html | 117 +++ ..._c68eb0c7512457e4_ingredient_types_py.html | 104 +++ htmlcov/z_c68eb0c7512457e4_praktikum_py.html | 139 ++++ 16 files changed, 2613 insertions(+) create mode 100644 htmlcov/.gitignore create mode 100644 htmlcov/class_index.html create mode 100644 htmlcov/coverage_html_cb_497bf287.js create mode 100644 htmlcov/favicon_32_cb_58284776.png create mode 100644 htmlcov/function_index.html create mode 100644 htmlcov/index.html create mode 100644 htmlcov/keybd_closed_cb_ce680311.png create mode 100644 htmlcov/status.json create mode 100644 htmlcov/style_cb_dca529e9.css create mode 100644 htmlcov/z_c68eb0c7512457e4___init___py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_bun_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_burger_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_database_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_praktikum_py.html diff --git a/htmlcov/.gitignore b/htmlcov/.gitignore new file mode 100644 index 000000000..ccccf1423 --- /dev/null +++ b/htmlcov/.gitignore @@ -0,0 +1,2 @@ +# Created by coverage.py +* diff --git a/htmlcov/class_index.html b/htmlcov/class_index.html new file mode 100644 index 000000000..97c531b48 --- /dev/null +++ b/htmlcov/class_index.html @@ -0,0 +1,195 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fileclassstatementsmissingexcludedcoverage
praktikum\__init__.py(no class)000100%
praktikum\bun.pyBun400100%
praktikum\bun.py(no class)400100%
praktikum\burger.pyBurger1600100%
praktikum\burger.py(no class)1100100%
praktikum\database.pyDatabase1300100%
praktikum\database.py(no class)800100%
praktikum\ingredient.pyIngredient600100%
praktikum\ingredient.py(no class)500100%
praktikum\ingredient_types.py(no class)200100%
praktikum\praktikum.py(no class)201095%
Total 891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/coverage_html_cb_497bf287.js b/htmlcov/coverage_html_cb_497bf287.js new file mode 100644 index 000000000..1face13de --- /dev/null +++ b/htmlcov/coverage_html_cb_497bf287.js @@ -0,0 +1,733 @@ +// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +// Coverage.py HTML report browser code. +/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ +/*global coverage: true, document, window, $ */ + +coverage = {}; + +// General helpers +function debounce(callback, wait) { + let timeoutId = null; + return function(...args) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + callback.apply(this, args); + }, wait); + }; +}; + +function checkVisible(element) { + const rect = element.getBoundingClientRect(); + const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); + const viewTop = 30; + return !(rect.bottom < viewTop || rect.top >= viewBottom); +} + +function on_click(sel, fn) { + const elt = document.querySelector(sel); + if (elt) { + elt.addEventListener("click", fn); + } +} + +// Helpers for table sorting +function getCellValue(row, column = 0) { + const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.childElementCount == 1) { + var child = cell.firstElementChild; + if (child.tagName === "A") { + child = child.firstElementChild; + } + if (child instanceof HTMLDataElement && child.value) { + return child.value; + } + } + return cell.innerText || cell.textContent; +} + +function rowComparator(rowA, rowB, column = 0) { + let valueA = getCellValue(rowA, column); + let valueB = getCellValue(rowB, column); + if (!isNaN(valueA) && !isNaN(valueB)) { + return valueA - valueB; + } + return valueA.localeCompare(valueB, undefined, {numeric: true}); +} + +function sortColumn(th) { + // Get the current sorting direction of the selected header, + // clear state on other headers and then set the new sorting direction. + const currentSortOrder = th.getAttribute("aria-sort"); + [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); + var direction; + if (currentSortOrder === "none") { + direction = th.dataset.defaultSortOrder || "ascending"; + } + else if (currentSortOrder === "ascending") { + direction = "descending"; + } + else { + direction = "ascending"; + } + th.setAttribute("aria-sort", direction); + + const column = [...th.parentElement.cells].indexOf(th) + + // Sort all rows and afterwards append them in order to move them in the DOM. + Array.from(th.closest("table").querySelectorAll("tbody tr")) + .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (direction === "ascending" ? 1 : -1)) + .forEach(tr => tr.parentElement.appendChild(tr)); + + // Save the sort order for next time. + if (th.id !== "region") { + let th_id = "file"; // Sort by file if we don't have a column id + let current_direction = direction; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)) + } + localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ + "th_id": th.id, + "direction": current_direction + })); + if (th.id !== th_id || document.getElementById("region")) { + // Sort column has changed, unset sorting by function or class. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": false, + "region_direction": current_direction + })); + } + } + else { + // Sort column has changed to by function or class, remember that. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": true, + "region_direction": direction + })); + } +} + +// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. +coverage.assign_shortkeys = function () { + document.querySelectorAll("[data-shortcut]").forEach(element => { + document.addEventListener("keypress", event => { + if (event.target.tagName.toLowerCase() === "input") { + return; // ignore keypress from search filter + } + if (event.key === element.dataset.shortcut) { + element.click(); + } + }); + }); +}; + +// Create the events for the filter box. +coverage.wire_up_filter = function () { + // Populate the filter and hide100 inputs if there are saved values for them. + const saved_filter_value = localStorage.getItem(coverage.FILTER_STORAGE); + if (saved_filter_value) { + document.getElementById("filter").value = saved_filter_value; + } + const saved_hide100_value = localStorage.getItem(coverage.HIDE100_STORAGE); + if (saved_hide100_value) { + document.getElementById("hide100").checked = JSON.parse(saved_hide100_value); + } + + // Cache elements. + const table = document.querySelector("table.index"); + const table_body_rows = table.querySelectorAll("tbody tr"); + const no_rows = document.getElementById("no_rows"); + + // Observe filter keyevents. + const filter_handler = (event => { + // Keep running total of each metric, first index contains number of shown rows + const totals = new Array(table.rows[0].cells.length).fill(0); + // Accumulate the percentage as fraction + totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection + + var text = document.getElementById("filter").value; + // Store filter value + localStorage.setItem(coverage.FILTER_STORAGE, text); + const casefold = (text === text.toLowerCase()); + const hide100 = document.getElementById("hide100").checked; + // Store hide value. + localStorage.setItem(coverage.HIDE100_STORAGE, JSON.stringify(hide100)); + + // Hide / show elements. + table_body_rows.forEach(row => { + var show = false; + // Check the text filter. + for (let column = 0; column < totals.length; column++) { + cell = row.cells[column]; + if (cell.classList.contains("name")) { + var celltext = cell.textContent; + if (casefold) { + celltext = celltext.toLowerCase(); + } + if (celltext.includes(text)) { + show = true; + } + } + } + + // Check the "hide covered" filter. + if (show && hide100) { + const [numer, denom] = row.cells[row.cells.length - 1].dataset.ratio.split(" "); + show = (numer !== denom); + } + + if (!show) { + // hide + row.classList.add("hidden"); + return; + } + + // show + row.classList.remove("hidden"); + totals[0]++; + + for (let column = 0; column < totals.length; column++) { + // Accumulate dynamic totals + cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + if (column === totals.length - 1) { + // Last column contains percentage + const [numer, denom] = cell.dataset.ratio.split(" "); + totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection + totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection + } + else { + totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection + } + } + }); + + // Show placeholder if no rows will be displayed. + if (!totals[0]) { + // Show placeholder, hide table. + no_rows.style.display = "block"; + table.style.display = "none"; + return; + } + + // Hide placeholder, show table. + no_rows.style.display = null; + table.style.display = null; + + const footer = table.tFoot.rows[0]; + // Calculate new dynamic sum values based on visible rows. + for (let column = 0; column < totals.length; column++) { + // Get footer cell element. + const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + + // Set value into dynamic footer cell element. + if (column === totals.length - 1) { + // Percentage column uses the numerator and denominator, + // and adapts to the number of decimal places. + const match = /\.([0-9]+)/.exec(cell.textContent); + const places = match ? match[1].length : 0; + const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection + cell.dataset.ratio = `${numer} ${denom}`; + // Check denom to prevent NaN if filtered files contain no statements + cell.textContent = denom + ? `${(numer * 100 / denom).toFixed(places)}%` + : `${(100).toFixed(places)}%`; + } + else { + cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection + } + } + }); + + document.getElementById("filter").addEventListener("input", debounce(filter_handler)); + document.getElementById("hide100").addEventListener("input", debounce(filter_handler)); + + // Trigger change event on setup, to force filter on page refresh + // (filter value may still be present). + document.getElementById("filter").dispatchEvent(new Event("input")); + document.getElementById("hide100").dispatchEvent(new Event("input")); +}; +coverage.FILTER_STORAGE = "COVERAGE_FILTER_VALUE"; +coverage.HIDE100_STORAGE = "COVERAGE_HIDE100_VALUE"; + +// Set up the click-to-sort columns. +coverage.wire_up_sorting = function () { + document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( + th => th.addEventListener("click", e => sortColumn(e.target)) + ); + + // Look for a localStorage item containing previous sort settings: + let th_id = "file", direction = "ascending"; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)); + } + let by_region = false, region_direction = "ascending"; + const sorted_by_region = localStorage.getItem(coverage.SORTED_BY_REGION); + if (sorted_by_region) { + ({ + by_region, + region_direction + } = JSON.parse(sorted_by_region)); + } + + const region_id = "region"; + if (by_region && document.getElementById(region_id)) { + direction = region_direction; + } + // If we are in a page that has a column with id of "region", sort on + // it if the last sort was by function or class. + let th; + if (document.getElementById(region_id)) { + th = document.getElementById(by_region ? region_id : th_id); + } + else { + th = document.getElementById(th_id); + } + th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); + th.click() +}; + +coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; +coverage.SORTED_BY_REGION = "COVERAGE_SORT_REGION"; + +// Loaded on index.html +coverage.index_ready = function () { + coverage.assign_shortkeys(); + coverage.wire_up_filter(); + coverage.wire_up_sorting(); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + + on_click(".button_show_hide_help", coverage.show_hide_help); +}; + +// -- pyfile stuff -- + +coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; + +coverage.pyfile_ready = function () { + // If we're directed to a particular line number, highlight the line. + var frag = location.hash; + if (frag.length > 2 && frag[1] === "t") { + document.querySelector(frag).closest(".n").classList.add("highlight"); + coverage.set_sel(parseInt(frag.substr(2), 10)); + } + else { + coverage.set_sel(0); + } + + on_click(".button_toggle_run", coverage.toggle_lines); + on_click(".button_toggle_mis", coverage.toggle_lines); + on_click(".button_toggle_exc", coverage.toggle_lines); + on_click(".button_toggle_par", coverage.toggle_lines); + + on_click(".button_next_chunk", coverage.to_next_chunk_nicely); + on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); + on_click(".button_top_of_page", coverage.to_top); + on_click(".button_first_chunk", coverage.to_first_chunk); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + on_click(".button_to_index", coverage.to_index); + + on_click(".button_show_hide_help", coverage.show_hide_help); + + coverage.filters = undefined; + try { + coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); + } catch(err) {} + + if (coverage.filters) { + coverage.filters = JSON.parse(coverage.filters); + } + else { + coverage.filters = {run: false, exc: true, mis: true, par: true}; + } + + for (cls in coverage.filters) { + coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection + } + + coverage.assign_shortkeys(); + coverage.init_scroll_markers(); + coverage.wire_up_sticky_header(); + + document.querySelectorAll("[id^=ctxs]").forEach( + cbox => cbox.addEventListener("click", coverage.expand_contexts) + ); + + // Rebuild scroll markers when the window height changes. + window.addEventListener("resize", coverage.build_scroll_markers); +}; + +coverage.toggle_lines = function (event) { + const btn = event.target.closest("button"); + const category = btn.value + const show = !btn.classList.contains("show_" + category); + coverage.set_line_visibilty(category, show); + coverage.build_scroll_markers(); + coverage.filters[category] = show; + try { + localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); + } catch(err) {} +}; + +coverage.set_line_visibilty = function (category, should_show) { + const cls = "show_" + category; + const btn = document.querySelector(".button_toggle_" + category); + if (btn) { + if (should_show) { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); + btn.classList.add(cls); + } + else { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); + btn.classList.remove(cls); + } + } +}; + +// Return the nth line div. +coverage.line_elt = function (n) { + return document.getElementById("t" + n)?.closest("p"); +}; + +// Set the selection. b and e are line numbers. +coverage.set_sel = function (b, e) { + // The first line selected. + coverage.sel_begin = b; + // The next line not selected. + coverage.sel_end = (e === undefined) ? b+1 : e; +}; + +coverage.to_top = function () { + coverage.set_sel(0, 1); + coverage.scroll_window(0); +}; + +coverage.to_first_chunk = function () { + coverage.set_sel(0, 1); + coverage.to_next_chunk(); +}; + +coverage.to_prev_file = function () { + window.location = document.getElementById("prevFileLink").href; +} + +coverage.to_next_file = function () { + window.location = document.getElementById("nextFileLink").href; +} + +coverage.to_index = function () { + location.href = document.getElementById("indexLink").href; +} + +coverage.show_hide_help = function () { + const helpCheck = document.getElementById("help_panel_state") + helpCheck.checked = !helpCheck.checked; +} + +// Return a string indicating what kind of chunk this line belongs to, +// or null if not a chunk. +coverage.chunk_indicator = function (line_elt) { + const classes = line_elt?.className; + if (!classes) { + return null; + } + const match = classes.match(/\bshow_\w+\b/); + if (!match) { + return null; + } + return match[0]; +}; + +coverage.to_next_chunk = function () { + const c = coverage; + + // Find the start of the next colored chunk. + var probe = c.sel_end; + var chunk_indicator, probe_line; + while (true) { + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + if (chunk_indicator) { + break; + } + probe++; + } + + // There's a next chunk, `probe` points to it. + var begin = probe; + + // Find the end of this chunk. + var next_indicator = chunk_indicator; + while (next_indicator === chunk_indicator) { + probe++; + probe_line = c.line_elt(probe); + next_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(begin, probe); + c.show_selection(); +}; + +coverage.to_prev_chunk = function () { + const c = coverage; + + // Find the end of the prev colored chunk. + var probe = c.sel_begin-1; + var probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + var chunk_indicator = c.chunk_indicator(probe_line); + while (probe > 1 && !chunk_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + } + + // There's a prev chunk, `probe` points to its last line. + var end = probe+1; + + // Find the beginning of this chunk. + var prev_indicator = chunk_indicator; + while (prev_indicator === chunk_indicator) { + probe--; + if (probe <= 0) { + return; + } + probe_line = c.line_elt(probe); + prev_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(probe+1, end); + c.show_selection(); +}; + +// Returns 0, 1, or 2: how many of the two ends of the selection are on +// the screen right now? +coverage.selection_ends_on_screen = function () { + if (coverage.sel_begin === 0) { + return 0; + } + + const begin = coverage.line_elt(coverage.sel_begin); + const end = coverage.line_elt(coverage.sel_end-1); + + return ( + (checkVisible(begin) ? 1 : 0) + + (checkVisible(end) ? 1 : 0) + ); +}; + +coverage.to_next_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the top line on the screen as selection. + + // This will select the top-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(0, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(1); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_next_chunk(); +}; + +coverage.to_prev_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the lowest line on the screen as selection. + + // This will select the bottom-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(coverage.lines_len); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_prev_chunk(); +}; + +// Select line number lineno, or if it is in a colored chunk, select the +// entire chunk +coverage.select_line_or_chunk = function (lineno) { + var c = coverage; + var probe_line = c.line_elt(lineno); + if (!probe_line) { + return; + } + var the_indicator = c.chunk_indicator(probe_line); + if (the_indicator) { + // The line is in a highlighted chunk. + // Search backward for the first line. + var probe = lineno; + var indicator = the_indicator; + while (probe > 0 && indicator === the_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + break; + } + indicator = c.chunk_indicator(probe_line); + } + var begin = probe + 1; + + // Search forward for the last line. + probe = lineno; + indicator = the_indicator; + while (indicator === the_indicator) { + probe++; + probe_line = c.line_elt(probe); + indicator = c.chunk_indicator(probe_line); + } + + coverage.set_sel(begin, probe); + } + else { + coverage.set_sel(lineno); + } +}; + +coverage.show_selection = function () { + // Highlight the lines in the chunk + document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); + for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { + coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); + } + + coverage.scroll_to_selection(); +}; + +coverage.scroll_to_selection = function () { + // Scroll the page if the chunk isn't fully visible. + if (coverage.selection_ends_on_screen() < 2) { + const element = coverage.line_elt(coverage.sel_begin); + coverage.scroll_window(element.offsetTop - 60); + } +}; + +coverage.scroll_window = function (to_pos) { + window.scroll({top: to_pos, behavior: "smooth"}); +}; + +coverage.init_scroll_markers = function () { + // Init some variables + coverage.lines_len = document.querySelectorAll("#source > p").length; + + // Build html + coverage.build_scroll_markers(); +}; + +coverage.build_scroll_markers = function () { + const temp_scroll_marker = document.getElementById("scroll_marker") + if (temp_scroll_marker) temp_scroll_marker.remove(); + // Don't build markers if the window has no scroll bar. + if (document.body.scrollHeight <= window.innerHeight) { + return; + } + + const marker_scale = window.innerHeight / document.body.scrollHeight; + const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); + + let previous_line = -99, last_mark, last_top; + + const scroll_marker = document.createElement("div"); + scroll_marker.id = "scroll_marker"; + document.getElementById("source").querySelectorAll( + "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" + ).forEach(element => { + const line_top = Math.floor(element.offsetTop * marker_scale); + const line_number = parseInt(element.querySelector(".n a").id.substr(1)); + + if (line_number === previous_line + 1) { + // If this solid missed block just make previous mark higher. + last_mark.style.height = `${line_top + line_height - last_top}px`; + } + else { + // Add colored line in scroll_marker block. + last_mark = document.createElement("div"); + last_mark.id = `m${line_number}`; + last_mark.classList.add("marker"); + last_mark.style.height = `${line_height}px`; + last_mark.style.top = `${line_top}px`; + scroll_marker.append(last_mark); + last_top = line_top; + } + + previous_line = line_number; + }); + + // Append last to prevent layout calculation + document.body.append(scroll_marker); +}; + +coverage.wire_up_sticky_header = function () { + const header = document.querySelector("header"); + const header_bottom = ( + header.querySelector(".content h2").getBoundingClientRect().top - + header.getBoundingClientRect().top + ); + + function updateHeader() { + if (window.scrollY > header_bottom) { + header.classList.add("sticky"); + } + else { + header.classList.remove("sticky"); + } + } + + window.addEventListener("scroll", updateHeader); + updateHeader(); +}; + +coverage.expand_contexts = function (e) { + var ctxs = e.target.parentNode.querySelector(".ctxs"); + + if (!ctxs.classList.contains("expanded")) { + var ctxs_text = ctxs.textContent; + var width = Number(ctxs_text[0]); + ctxs.textContent = ""; + for (var i = 1; i < ctxs_text.length; i += width) { + key = ctxs_text.substring(i, i + width).trim(); + ctxs.appendChild(document.createTextNode(contexts[key])); + ctxs.appendChild(document.createElement("br")); + } + ctxs.classList.add("expanded"); + } +}; + +document.addEventListener("DOMContentLoaded", () => { + if (document.body.classList.contains("indexfile")) { + coverage.index_ready(); + } + else { + coverage.pyfile_ready(); + } +}); diff --git a/htmlcov/favicon_32_cb_58284776.png b/htmlcov/favicon_32_cb_58284776.png new file mode 100644 index 0000000000000000000000000000000000000000..8649f0475d8d20793b2ec431fe25a186a414cf10 GIT binary patch literal 1732 zcmV;#20QtQP)K2KOkBOVxIZChq#W-v7@TU%U6P(wycKT1hUJUToW3ke1U1ONa4 z000000000000000bb)GRa9mqwR9|UWHy;^RUrt?IT__Y0JUcxmBP0(51q1>E00030 z|NrOz)aw7%8sJzM<5^g%z7^qE`}_Ot|JUUG(NUkWzR|7K?Zo%@_v-8G-1N%N=D$;; zw;keH4dGY$`1t4M=HK_s*zm^0#KgqfwWhe3qO_HtvXYvtjgX>;-~C$L`&k>^R)9)7 zdPh2TL^pCnHC#0+_4D)M`p?qp!pq{jO_{8;$fbaflbx`Tn52n|n}8VFRTA1&ugOP< zPd{uvFjz7t*Vot1&d$l-xWCk}s;sQL&#O(Bskh6gqNJv>#iB=ypG1e3K!K4yc7!~M zfj4S*g^zZ7eP$+_Sl07Z646l;%urinP#D8a6TwRtnLIRcI!r4f@bK~9-`~;E(N?Lv zSEst7s;rcxsi~}{Nsytfz@MtUoR*iFc8!#vvx}Umhm4blk(_~MdVD-@dW&>!Nn~ro z_E~-ESVQAj6Wmn;(olz(O&_{U2*pZBc1aYjMh>Dq3z|6`jW`RDHV=t3I6yRKJ~LOX zz_z!!vbVXPqob#=pj3^VMT?x6t(irRmSKsMo1~LLkB&=#j!=M%NP35mfqim$drWb9 zYIb>no_LUwc!r^NkDzs4YHu@=ZHRzrafWDZd1EhEVq=tGX?tK$pIa)DTh#bkvh!J- z?^%@YS!U*0E8$q$_*aOTQ&)Ra64g>ep;BdcQgvlg8qQHrP*E$;P{-m=A*@axn@$bO zO-Y4JzS&EAi%YG}N?cn?YFS7ivPY=EMV6~YH;+Xxu|tefLS|Aza)Cg6us#)=JW!uH zQa?H>d^j+YHCtyjL^LulF*05|F$RG!AX_OHVI&MtA~_@=5_lU|0000rbW%=J06GH4 z^5LD8b8apw8vNh1ua1mF{{Hy)_U`NA;Nacc+sCpuHXa-V{r&yz?c(9#+}oX+NmiRW z+W-IqK1oDDR5;6GfCDCOP5}iL5fK(cB~ET81`MFgF2kGa9AjhSIk~-E-4&*tPPKdiilQJ11k_J082ZS z>@TvivP!5ZFG?t@{t+GpR3XR&@*hA_VE1|Lo8@L@)l*h(Z@=?c-NS$Fk&&61IzUU9 z*nPqBM=OBZ-6ka1SJgGAS-Us5EN)r#dUX%>wQZLa2ytPCtMKp)Ob z*xcu38Z&d5<-NBS)@jRD+*!W*cf-m_wmxDEqBf?czI%3U0J$Xik;lA`jg}VH?(S(V zE!M3;X2B8w0TnnW&6(8;_Uc)WD;Ms6PKP+s(sFgO!}B!^ES~GDt4qLPxwYB)^7)XA zZwo9zDy-B0B+jT6V=!=bo(zs_8{eBA78gT9GH$(DVhz;4VAYwz+bOIdZ-PNb|I&rl z^XG=vFLF)1{&nT2*0vMz#}7^9hXzzf&ZdKlEj{LihP;|;Ywqn35ajP?H?7t|i-Un% z&&kxee@9B{nwgv1+S-~0)E1{ob1^Wn`F2isurqThKK=3%&;`@{0{!D- z&CSj80t;uPu&FaJFtSXKH#ajgGj}=sEad7US6jP0|Db@0j)?(5@sf<7`~a9>s;wCa zm^)spe{uxGFmrJYI9cOh7s$>8Npkt-5EWB1UKc`{W{y5Ce$1+nM9Cr;);=Ju#N^62OSlJMn7omiUgP&ErsYzT~iGxcW aE(`!K@+CXylaC4j0000 + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filefunctionstatementsmissingexcludedcoverage
praktikum\__init__.py(no function)000100%
praktikum\bun.pyBun.__init__200100%
praktikum\bun.pyBun.get_name100100%
praktikum\bun.pyBun.get_price100100%
praktikum\bun.py(no function)400100%
praktikum\burger.pyBurger.__init__200100%
praktikum\burger.pyBurger.set_buns100100%
praktikum\burger.pyBurger.add_ingredient100100%
praktikum\burger.pyBurger.remove_ingredient100100%
praktikum\burger.pyBurger.move_ingredient100100%
praktikum\burger.pyBurger.get_price400100%
praktikum\burger.pyBurger.get_receipt600100%
praktikum\burger.py(no function)1100100%
praktikum\database.pyDatabase.__init__1100100%
praktikum\database.pyDatabase.available_buns100100%
praktikum\database.pyDatabase.available_ingredients100100%
praktikum\database.py(no function)800100%
praktikum\ingredient.pyIngredient.__init__300100%
praktikum\ingredient.pyIngredient.get_price100100%
praktikum\ingredient.pyIngredient.get_name100100%
praktikum\ingredient.pyIngredient.get_type100100%
praktikum\ingredient.py(no function)500100%
praktikum\ingredient_types.py(no function)200100%
praktikum\praktikum.pymain1200100%
praktikum\praktikum.py(no function)81088%
Total 891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/index.html b/htmlcov/index.html new file mode 100644 index 000000000..af6baea00 --- /dev/null +++ b/htmlcov/index.html @@ -0,0 +1,153 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filestatementsmissingexcludedcoverage
praktikum\__init__.py000100%
praktikum\bun.py800100%
praktikum\burger.py2700100%
praktikum\database.py2100100%
praktikum\ingredient.py1100100%
praktikum\ingredient_types.py200100%
praktikum\praktikum.py201095%
Total891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/keybd_closed_cb_ce680311.png b/htmlcov/keybd_closed_cb_ce680311.png new file mode 100644 index 0000000000000000000000000000000000000000..ba119c47df81ed2bbd27a06988abf700139c4f99 GIT binary patch literal 9004 zcmeHLc{tSF+aIY=A^R4_poB4tZAN2XC;O7M(inrW3}(h&Q4}dl*&-65$i9^&vW6_# zcM4g`Qix=GhkBl;=lwnJ@Ap2}^}hc-b6vBXb3XUyzR%~}_c`-Dw+!?&>5p(90RRB> zXe~7($~PP3eT?=X<@3~Q1w84vX~IoSx~1#~02+TopXK(db;4v6!{+W`RHLkkHO zo;+s?)puc`+$yOwHv>I$5^8v^F3<|$44HA8AFnFB0cAP|C`p}aSMJK*-CUB{eQ!;K z-9Ju3OQ+xVPr3P#o4>_lNBT;M+1vgV&B~6!naOGHb-LFA9TkfHv1IFA1Y!Iz!Zl3) z%c#-^zNWPq7U_}6I7aHSmFWi125RZrNBKyvnV^?64)zviS;E!UD%LaGRl6@zn!3E{ zJ`B$5``cH_3a)t1#6I7d==JeB_IcSU%=I#DrRCBGm8GvCmA=+XHEvC2SIfsNa0(h9 z7P^C4U`W@@`9p>2f^zyb5B=lpc*RZMn-%%IqrxSWQF8{ec3i?-AB(_IVe z)XgT>Y^u41MwOMFvU=I4?!^#jaS-%bjnx@ zmL44yVEslR_ynm18F!u}Ru#moEn3EE?1=9@$B1Z5aLi5b8{&?V(IAYBzIar!SiY3< z`l0V)djHtrImy}(!7x-Pmq+njM)JFQ9mx*(C+9a3M)(_SW|lrN=gfxFhStu^zvynS zm@gl;>d8i8wpUkX42vS3BEzE3-yctH%t0#N%s+6-&_<*Fe7+h=`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QVNEY zmXwr4{9*jpDl%4{ggQZ5Ac z%wYTdl*!1c5^)%^E78Q&)ma|27c6j(a=)g4sGrp$r{jv>>M2 z6y)E5|Aooe!PSfKzvKA>`a6pfK3=E8vL14ksP&f=>gOP?}rG6ye@9ZR3 zJF*vsh*P$w390i!FV~~_Hv6t2Zl<4VUi|rNja#boFt{%q~xGb z(2petq9A*_>~B*>?d?Olx^lmYg4)}sH2>G42RE; literal 0 HcmV?d00001 diff --git a/htmlcov/status.json b/htmlcov/status.json new file mode 100644 index 000000000..e09334d56 --- /dev/null +++ b/htmlcov/status.json @@ -0,0 +1 @@ +{"note":"This file is an internal implementation detail to speed up HTML report generation. Its format can change at any time. You might be looking for the JSON report: https://coverage.rtfd.io/cmd.html#cmd-json","format":5,"version":"7.11.0","globals":"37549cb6f10abc1cc097c51bdc6b860d","files":{"z_c68eb0c7512457e4___init___py":{"hash":"bd020ce57c982120e8c32a91267d330d","index":{"url":"z_c68eb0c7512457e4___init___py.html","file":"praktikum\\__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_bun_py":{"hash":"820fa7fb820fb46cf300dac8d31b6bd0","index":{"url":"z_c68eb0c7512457e4_bun_py.html","file":"praktikum\\bun.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":8,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_burger_py":{"hash":"facdb0a5be4ca4a1f2f321d5a2d8fb87","index":{"url":"z_c68eb0c7512457e4_burger_py.html","file":"praktikum\\burger.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":27,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_database_py":{"hash":"30732bb755a2f38ad46148435b66601a","index":{"url":"z_c68eb0c7512457e4_database_py.html","file":"praktikum\\database.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":21,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_py":{"hash":"d1fcf36fcdce67a9051fb6dc31d4fcd0","index":{"url":"z_c68eb0c7512457e4_ingredient_py.html","file":"praktikum\\ingredient.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":11,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_types_py":{"hash":"2bcd1d2d9846c4979e7b61455ec13758","index":{"url":"z_c68eb0c7512457e4_ingredient_types_py.html","file":"praktikum\\ingredient_types.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":2,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_praktikum_py":{"hash":"7678957e5e3cc7b8263bb309fbd85bc3","index":{"url":"z_c68eb0c7512457e4_praktikum_py.html","file":"praktikum\\praktikum.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":20,"n_excluded":0,"n_missing":1,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}}}} \ No newline at end of file diff --git a/htmlcov/style_cb_dca529e9.css b/htmlcov/style_cb_dca529e9.css new file mode 100644 index 000000000..4735f2702 --- /dev/null +++ b/htmlcov/style_cb_dca529e9.css @@ -0,0 +1,377 @@ +@charset "UTF-8"; +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ +/* Don't edit this .css file. Edit the .scss file instead! */ +html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } + +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { body { color: #eee; } } + +html > body { font-size: 16px; } + +a:active, a:focus { outline: 2px dashed #007acc; } + +p { font-size: .875em; line-height: 1.4em; } + +table { border-collapse: collapse; } + +td { vertical-align: top; } + +table tr.hidden { display: none !important; } + +p#no_rows { display: none; font-size: 1.15em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +a.nav { text-decoration: none; color: inherit; } + +a.nav:hover { text-decoration: underline; color: inherit; } + +.hidden { display: none; } + +header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } + +@media (prefers-color-scheme: dark) { header { background: black; } } + +@media (prefers-color-scheme: dark) { header { border-color: #333; } } + +header .content { padding: 1rem 3.5rem; } + +header h2 { margin-top: .5em; font-size: 1em; } + +header h2 a.button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header h2 a.button { background: #333; } } + +@media (prefers-color-scheme: dark) { header h2 a.button { border-color: #444; } } + +header h2 a.button.current { border: 2px solid; background: #fff; border-color: #999; cursor: default; } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { border-color: #777; } } + +header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } + +header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } + +header.sticky .text { display: none; } + +header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } + +header.sticky .content { padding: 0.5rem 3.5rem; } + +header.sticky .content p { font-size: 1em; } + +header.sticky ~ #source { padding-top: 6.5em; } + +main { position: relative; z-index: 1; } + +footer { margin: 1rem 3.5rem; } + +footer .content { padding: 0; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } + +#index { margin: 1rem 0 0 3.5rem; } + +h1 { font-size: 1.25em; display: inline-block; } + +#filter_container { float: right; margin: 0 2em 0 0; line-height: 1.66em; } + +#filter_container #filter { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { #filter_container #filter { border-color: #444; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { color: #eee; } } + +#filter_container #filter:focus { border-color: #007acc; } + +#filter_container :disabled ~ label { color: #ccc; } + +@media (prefers-color-scheme: dark) { #filter_container :disabled ~ label { color: #444; } } + +#filter_container label { font-size: .875em; color: #666; } + +@media (prefers-color-scheme: dark) { #filter_container label { color: #aaa; } } + +header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header button { background: #333; } } + +@media (prefers-color-scheme: dark) { header button { border-color: #444; } } + +header button:active, header button:focus { outline: 2px dashed #007acc; } + +header button.run { background: #eeffee; } + +@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } + +header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } + +header button.mis { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } + +header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } + +header button.exc { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } + +header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } + +header button.par { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { header button.par { background: #650; } } + +header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } + +#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } + +#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } + +#help_panel_wrapper { float: right; position: relative; } + +#keyboard_icon { margin: 5px; } + +#help_panel_state { display: none; } + +#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } + +#help_panel .keyhelp p { margin-top: .75em; } + +#help_panel .legend { font-style: italic; margin-bottom: 1em; } + +.indexfile #help_panel { width: 25em; } + +.pyfile #help_panel { width: 18em; } + +#help_panel_state:checked ~ #help_panel { display: block; } + +kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } + +#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } + +#source p { position: relative; white-space: pre; } + +#source p * { box-sizing: border-box; } + +#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; user-select: none; } + +@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } + +#source p .n.highlight { background: #ffdd00; } + +#source p .n a { scroll-margin-top: 6em; text-decoration: none; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } + +#source p .n a:hover { text-decoration: underline; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } + +#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } + +@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } + +#source p .t:hover { background: #f2f2f2; } + +@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } + +#source p .t:hover ~ .r .annotate.long { display: block; } + +#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } + +@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } + +#source p .t .key { font-weight: bold; line-height: 1px; } + +#source p .t .str, #source p .t .fst { color: #0451a5; } + +@media (prefers-color-scheme: dark) { #source p .t .str, #source p .t .fst { color: #9cdcfe; } } + +#source p.mis .t { border-left: 0.2em solid #ff0000; } + +#source p.mis.show_mis .t { background: #fdd; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } + +#source p.mis.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } + +#source p.mis.mis2 .t { border-left: 0.2em dotted #ff0000; } + +#source p.mis.mis2.show_mis .t { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t { background: #351b1b; } } + +#source p.mis.mis2.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t:hover { background: #532323; } } + +#source p.run .t { border-left: 0.2em solid #00dd00; } + +#source p.run.show_run .t { background: #dfd; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } + +#source p.run.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } + +#source p.run.run2 .t { border-left: 0.2em dotted #00dd00; } + +#source p.run.run2.show_run .t { background: #eeffee; } + +@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t { background: #2b2e24; } } + +#source p.run.run2.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t:hover { background: #404633; } } + +#source p.exc .t { border-left: 0.2em solid #808080; } + +#source p.exc.show_exc .t { background: #eee; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } + +#source p.exc.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } + +#source p.exc.exc2 .t { border-left: 0.2em dotted #808080; } + +#source p.exc.exc2.show_exc .t { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t { background: #292929; } } + +#source p.exc.exc2.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t:hover { background: #3c3c3c; } } + +#source p.par .t { border-left: 0.2em solid #bbbb00; } + +#source p.par.show_par .t { background: #ffa; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } + +#source p.par.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } + +#source p.par.par2 .t { border-left: 0.2em dotted #bbbb00; } + +#source p.par.par2.show_par .t { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t { background: #423a0f; } } + +#source p.par.par2.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t:hover { background: #6d5d0c; } } + +#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } + +@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } + +#source p .annotate.short:hover ~ .long { display: block; } + +#source p .annotate.long { width: 30em; right: 2.5em; } + +#source p input { display: none; } + +#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } + +#source p input ~ .r label.ctx::before { content: "▶ "; } + +#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } + +#source p input:checked ~ .r label.ctx::before { content: "▼ "; } + +#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } + +#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } + +@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } + +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } + +#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } + +#index table.index { margin-left: -.5em; } + +#index td, #index th { text-align: right; padding: .25em .5em; border-bottom: 1px solid #eee; } + +@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } + +#index td.name, #index th.name { text-align: left; width: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; min-width: 15em; } + +#index th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-style: italic; color: #333; cursor: pointer; } + +@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } + +#index th:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } + +#index th .arrows { color: #666; font-size: 85%; font-family: sans-serif; font-style: normal; pointer-events: none; } + +#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } + +@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } + +#index th[aria-sort="ascending"] .arrows::after { content: " ▲"; } + +#index th[aria-sort="descending"] .arrows::after { content: " ▼"; } + +#index td.name { font-size: 1.15em; } + +#index td.name a { text-decoration: none; color: inherit; } + +#index td.name .no-noun { font-style: italic; } + +#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } + +#index tr.region:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index tr.region:hover { background: #333; } } + +#index tr.region:hover td.name { text-decoration: underline; color: inherit; } + +#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } + +@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } + +#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } + +@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/htmlcov/z_c68eb0c7512457e4___init___py.html b/htmlcov/z_c68eb0c7512457e4___init___py.html new file mode 100644 index 000000000..55c255a59 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4___init___py.html @@ -0,0 +1,98 @@ + + + + + Coverage for praktikum\__init__.py: 100% + + + + + +
+
+

+ Coverage for praktikum\__init__.py: + 100% +

+ +

+ 0 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_bun_py.html b/htmlcov/z_c68eb0c7512457e4_bun_py.html new file mode 100644 index 000000000..a76e57dfb --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_bun_py.html @@ -0,0 +1,112 @@ + + + + + Coverage for praktikum\bun.py: 100% + + + + + +
+
+

+ Coverage for praktikum\bun.py: + 100% +

+ +

+ 8 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1class Bun: 

+

2 """ 

+

3 Модель булочки для бургера. 

+

4 Булочке можно дать название и назначить цену. 

+

5 """ 

+

6 

+

7 def __init__(self, name: str, price: float): 

+

8 self.name = name 

+

9 self.price = price 

+

10 

+

11 def get_name(self) -> str: 

+

12 return self.name 

+

13 

+

14 def get_price(self) -> float: 

+

15 return self.price 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_burger_py.html b/htmlcov/z_c68eb0c7512457e4_burger_py.html new file mode 100644 index 000000000..554ae7136 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_burger_py.html @@ -0,0 +1,145 @@ + + + + + Coverage for praktikum\burger.py: 100% + + + + + +
+
+

+ Coverage for praktikum\burger.py: + 100% +

+ +

+ 27 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1from typing import List 

+

2 

+

3from praktikum.bun import Bun 

+

4from praktikum.ingredient import Ingredient 

+

5 

+

6 

+

7class Burger: 

+

8 """ 

+

9 Модель бургера. 

+

10 Бургер состоит из булочек и ингредиентов (начинка или соус). 

+

11 Ингредиенты можно перемещать и удалять. 

+

12 Можно распечать чек с информацией о бургере. 

+

13 """ 

+

14 

+

15 def __init__(self): 

+

16 self.bun = None 

+

17 self.ingredients: List[Ingredient] = [] 

+

18 

+

19 def set_buns(self, bun: Bun): 

+

20 self.bun = bun 

+

21 

+

22 def add_ingredient(self, ingredient: Ingredient): 

+

23 self.ingredients.append(ingredient) 

+

24 

+

25 def remove_ingredient(self, index: int): 

+

26 del self.ingredients[index] 

+

27 

+

28 def move_ingredient(self, index: int, new_index: int): 

+

29 self.ingredients.insert(new_index, self.ingredients.pop(index)) 

+

30 

+

31 def get_price(self) -> float: 

+

32 price = self.bun.get_price() * 2 

+

33 

+

34 for ingredient in self.ingredients: 

+

35 price += ingredient.get_price() 

+

36 

+

37 return price 

+

38 

+

39 def get_receipt(self) -> str: 

+

40 receipt: List[str] = [f'(==== {self.bun.get_name()} ====)'] 

+

41 

+

42 for ingredient in self.ingredients: 

+

43 receipt.append(f'= {str(ingredient.get_type()).lower()} {ingredient.get_name()} =') 

+

44 

+

45 receipt.append(f'(==== {self.bun.get_name()} ====)\n') 

+

46 receipt.append(f'Price: {self.get_price()}') 

+

47 

+

48 return '\n'.join(receipt) 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_database_py.html b/htmlcov/z_c68eb0c7512457e4_database_py.html new file mode 100644 index 000000000..8e158dfb8 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_database_py.html @@ -0,0 +1,130 @@ + + + + + Coverage for praktikum\database.py: 100% + + + + + +
+
+

+ Coverage for praktikum\database.py: + 100% +

+ +

+ 21 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1from typing import List 

+

2 

+

3from praktikum.bun import Bun 

+

4from praktikum.ingredient import Ingredient 

+

5from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING 

+

6 

+

7 

+

8class Database: 

+

9 """ 

+

10 Класс с методами по работе с базой данных. 

+

11 """ 

+

12 

+

13 def __init__(self): 

+

14 self.buns: List[Bun] = [] 

+

15 self.ingredients: List[Ingredient] = [] 

+

16 

+

17 self.buns.append(Bun("black bun", 100)) 

+

18 self.buns.append(Bun("white bun", 200)) 

+

19 self.buns.append(Bun("red bun", 300)) 

+

20 

+

21 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 100)) 

+

22 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "sour cream", 200)) 

+

23 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "chili sauce", 300)) 

+

24 

+

25 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "cutlet", 100)) 

+

26 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "dinosaur", 200)) 

+

27 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "sausage", 300)) 

+

28 

+

29 def available_buns(self) -> List[Bun]: 

+

30 return self.buns 

+

31 

+

32 def available_ingredients(self) -> List[Ingredient]: 

+

33 return self.ingredients 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_py.html new file mode 100644 index 000000000..cd951afc6 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_ingredient_py.html @@ -0,0 +1,117 @@ + + + + + Coverage for praktikum\ingredient.py: 100% + + + + + +
+
+

+ Coverage for praktikum\ingredient.py: + 100% +

+ +

+ 11 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1class Ingredient: 

+

2 """ 

+

3 Модель ингредиента. 

+

4 Ингредиент: начинка или соус. 

+

5 У ингредиента есть тип (начинка или соус), название и цена. 

+

6 """ 

+

7 

+

8 def __init__(self, ingredient_type: str, name: str, price: float): 

+

9 self.type = ingredient_type 

+

10 self.name = name 

+

11 self.price = price 

+

12 

+

13 def get_price(self) -> float: 

+

14 return self.price 

+

15 

+

16 def get_name(self) -> str: 

+

17 return self.name 

+

18 

+

19 def get_type(self) -> str: 

+

20 return self.type 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html new file mode 100644 index 000000000..ce28baf35 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html @@ -0,0 +1,104 @@ + + + + + Coverage for praktikum\ingredient_types.py: 100% + + + + + +
+
+

+ Coverage for praktikum\ingredient_types.py: + 100% +

+ +

+ 2 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1""" 

+

2Перечисление с типами ингредиентов. 

+

3SAUCE – соус 

+

4FILLING – начинка 

+

5""" 

+

6INGREDIENT_TYPE_SAUCE = 'SAUCE' 

+

7INGREDIENT_TYPE_FILLING = 'FILLING' 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_praktikum_py.html b/htmlcov/z_c68eb0c7512457e4_praktikum_py.html new file mode 100644 index 000000000..7dac16d95 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_praktikum_py.html @@ -0,0 +1,139 @@ + + + + + Coverage for praktikum\praktikum.py: 95% + + + + + +
+
+

+ Coverage for praktikum\praktikum.py: + 95% +

+ +

+ 20 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2025-12-24 21:19 +0100 +

+ +
+
+
+

1 

+

2from typing import List 

+

3 

+

4from praktikum.bun import Bun 

+

5from praktikum.burger import Burger 

+

6from praktikum.database import Database 

+

7from praktikum.ingredient import Ingredient 

+

8 

+

9 

+

10def main(): 

+

11 # Инициализируем базу данных 

+

12 database: Database = Database() 

+

13 

+

14 # Создадим новый бургер 

+

15 burger: Burger = Burger() 

+

16 

+

17 # Считаем список доступных булок из базы данных 

+

18 buns: List[Bun] = database.available_buns() 

+

19 

+

20 # Считаем список доступных ингредиентов из базы данных 

+

21 ingredients: List[Ingredient] = database.available_ingredients() 

+

22 

+

23 # Соберём бургер 

+

24 burger.set_buns(buns[0]) 

+

25 

+

26 burger.add_ingredient(ingredients[1]) 

+

27 burger.add_ingredient(ingredients[4]) 

+

28 burger.add_ingredient(ingredients[3]) 

+

29 burger.add_ingredient(ingredients[5]) 

+

30 

+

31 # Переместим слой с ингредиентом 

+

32 burger.move_ingredient(2, 1) 

+

33 

+

34 # Удалим ингредиент 

+

35 burger.remove_ingredient(3) 

+

36 

+

37 # Распечатаем рецепт бургера 

+

38 print(burger.get_receipt()) 

+

39 

+

40 

+

41if __name__ == "__main__": 

+

42 main() 

+
+ + + From 5b717254ec13ee987a461d18af5a2aa5f31703a5 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:04:16 +0100 Subject: [PATCH 43/54] Update conftest.py --- tests/conftest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index c8a763eab..5780efc9f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -50,8 +50,6 @@ def burger_with_ingredients(mock_bun, mock_sauce_ingredient, mock_filling_ingred -# ... существующий код ... - @pytest.fixture def mock_database(): """Фикстура для создания мока базы данных""" From ef6836e65cf599dcecae54ad4b45123ebae7c435 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:04:50 +0100 Subject: [PATCH 44/54] Update test_bun.py --- tests/test_bun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_bun.py b/tests/test_bun.py index 12ebba8f5..ecb75d7d9 100644 --- a/tests/test_bun.py +++ b/tests/test_bun.py @@ -24,7 +24,7 @@ def test_bun_price_is_float(self): assert isinstance(bun.get_price(), float) assert bun.get_price() == 100.0 - # Test with int (should still work) + # Test with int bun2 = Bun("Test bun 2", 200) # Don't check type, just check arithmetic works total = bun.get_price() + bun2.get_price() From 1ba6d425bab958dd5a231661bee8bee42a3c2c05 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:07:42 +0100 Subject: [PATCH 45/54] Update test_burger.py --- tests/test_burger.py | 60 +++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/tests/test_burger.py b/tests/test_burger.py index 6bed3c8e9..fec7dde9b 100644 --- a/tests/test_burger.py +++ b/tests/test_burger.py @@ -1,5 +1,5 @@ """ -Тесты для класса Burger из burger.py +Тесты для класса Burger Включает использование моков и параметризации """ import pytest @@ -15,43 +15,42 @@ class TestBurger: def test_burger_initialization(self): """Проверка инициализации пустого бургера""" - # Arrange & Act + burger = Burger() - # Assert assert burger.bun is None assert burger.ingredients == [] def test_set_buns(self): """Проверка установки булочек в бургер""" - # Arrange + burger = Burger() mock_bun = Mock() mock_bun.get_name.return_value = "Тестовая булочка" mock_bun.get_price.return_value = 100.0 - # Act + burger.set_buns(mock_bun) - # Assert + assert burger.bun == mock_bun def test_add_ingredient(self): """Проверка добавления ингредиента в бургер""" - # Arrange + burger = Burger() mock_ingredient = Mock() - # Act + burger.add_ingredient(mock_ingredient) - # Assert + assert len(burger.ingredients) == 1 assert burger.ingredients[0] == mock_ingredient def test_remove_ingredient(self): """Проверка удаления ингредиента по индексу""" - # Arrange + burger = Burger() mock_ingredient1 = Mock() mock_ingredient2 = Mock() @@ -61,10 +60,10 @@ def test_remove_ingredient(self): burger.add_ingredient(mock_ingredient2) burger.add_ingredient(mock_ingredient3) - # Act + burger.remove_ingredient(1) # Удаляем второй ингредиент - # Assert + assert len(burger.ingredients) == 2 assert burger.ingredients[0] == mock_ingredient1 assert burger.ingredients[1] == mock_ingredient3 @@ -76,24 +75,24 @@ def test_remove_ingredient(self): ]) def test_move_ingredient(self, index, new_index, expected_order): """Параметризованный тест перемещения ингредиентов""" - # Arrange + burger = Burger() mock_ingredients = [Mock(), Mock(), Mock()] for ingredient in mock_ingredients: burger.add_ingredient(ingredient) - # Act + burger.move_ingredient(index, new_index) - # Assert + # Проверяем новый порядок ингредиентов for i, expected_idx in enumerate(expected_order): assert burger.ingredients[i] == mock_ingredients[expected_idx] def test_get_price_with_mocks(self): """Тест расчета цены бургера с использованием моков""" - # Arrange + burger = Burger() # Создаем моки для булочки и ингредиентов @@ -106,13 +105,13 @@ def test_get_price_with_mocks(self): mock_ingredient1.get_price.return_value = 50.0 # Ингредиент 1 mock_ingredient2.get_price.return_value = 30.0 # Ингредиент 2 - # Act + burger.set_buns(mock_bun) burger.add_ingredient(mock_ingredient1) burger.add_ingredient(mock_ingredient2) total_price = burger.get_price() - # Assert + # Ожидаемая цена: (100 * 2) + 50 + 30 = 280 expected_price = 280.0 assert total_price == expected_price @@ -129,7 +128,7 @@ def test_get_price_with_mocks(self): ]) def test_get_price_parametrized(self, bun_price, ingredient_prices, expected_total): """Параметризованный тест расчета цены с разными значениями""" - # Arrange + burger = Burger() mock_bun = Mock() @@ -141,32 +140,32 @@ def test_get_price_parametrized(self, bun_price, ingredient_prices, expected_tot mock_ingr.get_price.return_value = price mock_ingredients.append(mock_ingr) - # Act + burger.set_buns(mock_bun) for ingredient in mock_ingredients: burger.add_ingredient(ingredient) total_price = burger.get_price() - # Assert + assert total_price == expected_total def test_get_receipt_with_real_objects(self): """Тест формирования чека с реальными объектами""" - # Arrange + burger = Burger() bun = Bun("Черная булочка", 100.0) ingredient1 = Ingredient(INGREDIENT_TYPE_SAUCE, "горчичный соус", 50.0) ingredient2 = Ingredient(INGREDIENT_TYPE_FILLING, "котлета", 100.0) - # Act + burger.set_buns(bun) burger.add_ingredient(ingredient1) burger.add_ingredient(ingredient2) receipt = burger.get_receipt() - # Assert + assert "(==== Черная булочка ====)" in receipt assert "= sauce горчичный соус =" in receipt assert "= filling котлета =" in receipt @@ -174,7 +173,7 @@ def test_get_receipt_with_real_objects(self): def test_get_receipt_with_mocks(self): """Тест формирования чека с использованием моков""" - # Arrange + burger = Burger() mock_bun = Mock() @@ -191,13 +190,12 @@ def test_get_receipt_with_mocks(self): mock_ingredient2.get_name.return_value = "салат" mock_ingredient2.get_price.return_value = 30.0 - # Act burger.set_buns(mock_bun) burger.add_ingredient(mock_ingredient1) burger.add_ingredient(mock_ingredient2) receipt = burger.get_receipt() - # Assert + expected_lines = [ "(==== Тестовая булочка ====)", "= sauce кетчуп =", @@ -211,22 +209,22 @@ def test_get_receipt_with_mocks(self): def test_remove_ingredient_invalid_index(self): """Тест попытки удаления ингредиента с неверным индексом""" - # Arrange + burger = Burger() mock_ingredient = Mock() burger.add_ingredient(mock_ingredient) - # Act & Assert + with pytest.raises(IndexError): burger.remove_ingredient(5) # Неверный индекс def test_move_ingredient_invalid_index(self): """Тест попытки перемещения ингредиента с неверным индексом""" - # Arrange + burger = Burger() mock_ingredient = Mock() burger.add_ingredient(mock_ingredient) - # Act & Assert + with pytest.raises(IndexError): burger.move_ingredient(5, 0) # Неверный исходный индекс From 2743c1356cba5c866be6a0cd82c22db60fa475c7 Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:08:43 +0100 Subject: [PATCH 46/54] Update test_database.py --- tests/test_database.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tests/test_database.py b/tests/test_database.py index 27598d62a..8a8487e4c 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -13,10 +13,10 @@ class TestDatabase: def test_database_initialization(self): """Проверка инициализации базы данных""" - # Arrange & Act + database = Database() - # Assert + # Проверяем количество булочек assert len(database.buns) == 3 # Проверяем количество ингредиентов (3 соуса + 3 начинки) @@ -24,13 +24,11 @@ def test_database_initialization(self): def test_available_buns(self): """Проверка получения списка доступных булочек""" - # Arrange + database = Database() - # Act buns = database.available_buns() - # Assert assert isinstance(buns, list) assert len(buns) == 3 @@ -46,13 +44,13 @@ def test_available_buns(self): def test_available_ingredients(self): """Проверка получения списка доступных ингредиентов""" - # Arrange + database = Database() - # Act + ingredients = database.available_ingredients() - # Assert + assert isinstance(ingredients, list) assert len(ingredients) == 6 @@ -67,13 +65,13 @@ def test_available_ingredients(self): def test_bun_prices(self): """Проверка цен булочек в базе данных""" - # Arrange + database = Database() - # Act + buns = database.available_buns() - # Assert + prices = [bun.get_price() for bun in buns] assert 100.0 in prices # black bun assert 200.0 in prices # white bun @@ -81,19 +79,19 @@ def test_bun_prices(self): def test_ingredient_names(self): """Проверка названий ингредиентов в базе данных""" - # Arrange + database = Database() - # Act + ingredients = database.available_ingredients() ingredient_names = [ingredient.get_name() for ingredient in ingredients] - # Assert для соусов + # для соусов assert "hot sauce" in ingredient_names assert "sour cream" in ingredient_names assert "chili sauce" in ingredient_names - # Assert для начинок + # для начинок assert "cutlet" in ingredient_names assert "dinosaur" in ingredient_names assert "sausage" in ingredient_names From 6e2109195f30002d10340ea4a0c95d733ee85a6d Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:09:26 +0100 Subject: [PATCH 47/54] Update test_ingredient.py --- tests/test_ingredient.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_ingredient.py b/tests/test_ingredient.py index f5a76a7ef..3e571c883 100644 --- a/tests/test_ingredient.py +++ b/tests/test_ingredient.py @@ -23,12 +23,11 @@ def test_ingredient_types(self): def test_ingredient_price_is_numeric(self): """Check that price works numerically""" - # Test with float + ingredient = Ingredient(INGREDIENT_TYPE_SAUCE, "mayonnaise", 45.0) assert ingredient.get_price() == 45.0 - # Test with int ingredient2 = Ingredient(INGREDIENT_TYPE_FILLING, "lettuce", 30) - # Just check arithmetic works, not type + total = ingredient.get_price() + ingredient2.get_price() assert total == 75.0 From d220736701ce2ec1d464302c3c1c914c28ca18cd Mon Sep 17 00:00:00 2001 From: OKorzinina <107882650+OKorzinina@users.noreply.github.com> Date: Sun, 28 Dec 2025 00:11:56 +0100 Subject: [PATCH 48/54] Update test_praktikum.py --- tests/test_praktikum.py | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/tests/test_praktikum.py b/tests/test_praktikum.py index 8990ca6a3..46713e37e 100644 --- a/tests/test_praktikum.py +++ b/tests/test_praktikum.py @@ -20,8 +20,7 @@ def test_main_function_creates_burger_correctly(self, mock_database_class, mock_ 4. Перемещает и удаляет ингредиенты 5. Выводит правильный чек """ - # ===== ARRANGE ===== - # Создаем мок для экземпляра Database + mock_database_instance = Mock() mock_database_class.return_value = mock_database_instance @@ -64,12 +63,11 @@ def test_main_function_creates_burger_correctly(self, mock_database_class, mock_ mock_database_instance.available_buns.return_value = mock_buns mock_database_instance.available_ingredients.return_value = mock_ingredients - # ===== ACT ===== - # Вызываем тестируемую функцию + main() - # ===== ASSERT ===== - # 1. Проверяем создание Database + + # 1.Проверяем создание Database mock_database_class.assert_called_once() # 2. Проверяем вызовы методов базы данных @@ -94,7 +92,7 @@ def test_main_uses_correct_indices_from_database(self, mock_database_class, mock - buns[0] - первая булочка - ingredients[1], [4], [3], [5] - конкретные ингредиенты """ - # ===== ARRANGE ===== + mock_database_instance = Mock() mock_database_class.return_value = mock_database_instance @@ -113,7 +111,7 @@ def test_main_uses_correct_indices_from_database(self, mock_database_class, mock # ===== ACT ===== main() - # ===== ASSERT ===== + # Проверяем вызовы методов Burger с правильными аргументами mock_burger_instance.set_buns.assert_called_once_with(mock_buns[0]) @@ -142,7 +140,7 @@ def test_main_handles_empty_database(self, mock_database_class, mock_print): """ Тестируем обработку пустой базы данных """ - # ===== ARRANGE ===== + mock_database_instance = Mock() mock_database_class.return_value = mock_database_instance @@ -150,7 +148,7 @@ def test_main_handles_empty_database(self, mock_database_class, mock_print): mock_database_instance.available_buns.return_value = [] mock_database_instance.available_ingredients.return_value = [] - # ===== ACT & ASSERT ===== + # Должно вызвать IndexError при попытке обращения по индексу with pytest.raises(IndexError): main() @@ -159,7 +157,7 @@ def test_main_can_be_imported(self): """ Проверяем, что модуль можно импортировать без ошибок """ - # Эта проверка гарантирует, что синтаксис модуля корректен + from praktikum.praktikum import main assert callable(main) @@ -169,7 +167,7 @@ def test_main_price_calculation_integration(self, mock_database_class, mock_prin """ Интеграционный тест: проверяем правильность расчета цены """ - # ===== ARRANGE ===== + mock_database_instance = Mock() mock_database_class.return_value = mock_database_instance @@ -194,15 +192,8 @@ def test_main_price_calculation_integration(self, mock_database_class, mock_prin mock_database_instance.available_buns.return_value = mock_buns mock_database_instance.available_ingredients.return_value = mock_ingredients - # ===== ACT ===== - main() - # ===== ASSERT ===== - # main() добавляет: ingredients[1], [4], [3], [5] - # Цены: sour cream(200) + dinosaur(200) + cutlet(100) + sausage(300) = 800 - # Плюс булочка black bun: 100 * 2 = 200 - # Итого: 200 + 800 = 1000 - - # Проверяем, что в чеке есть правильная цена + main() + printed_receipt = mock_print.call_args[0][0] assert "Price: 700" in printed_receipt From d3fe91d08480d39778ba6ea9480dc82c71b472b2 Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Sun, 28 Dec 2025 19:34:29 +0100 Subject: [PATCH 49/54] =?UTF-8?q?fix:=20=D0=A0=D0=B0=D0=B7=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D1=80=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0=20=D0=BD=D0=B0=20=D0=B0=D1=82=D0=BE=D0=BC=D0=B0?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B5=20=D1=81=D0=BE=D0=B3=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_bun.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_bun.py b/tests/test_bun.py index 12ebba8f5..7f910d5ac 100644 --- a/tests/test_bun.py +++ b/tests/test_bun.py @@ -18,14 +18,13 @@ def test_bun_getters_with_different_values(self, name, price): assert bun.get_price() == price def test_bun_price_is_float(self): - """Check that price works as float""" - # Test with float + """Проверка, что цена корректно возвращается как float при инициализации float значением""" bun = Bun("Test bun", 100.0) assert isinstance(bun.get_price(), float) assert bun.get_price() == 100.0 - - # Test with int (should still work) - bun2 = Bun("Test bun 2", 200) - # Don't check type, just check arithmetic works - total = bun.get_price() + bun2.get_price() - assert total == 300.0 + + def test_bun_price_with_int_input(self): + """Проверка, что при передаче целого числа (int) цена корректно сохраняется и доступна""" + bun = Bun("Test bun 2", 200) + # Проверяем конечное состояние объекта — значение цены + assert bun.get_price() == 200 \ No newline at end of file From 0861aa3e5fcb5537f72a3314071152865c442299 Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Sun, 28 Dec 2025 19:52:59 +0100 Subject: [PATCH 50/54] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=B0=D1=82=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_ingredient.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/test_ingredient.py b/tests/test_ingredient.py index 3e571c883..46a561713 100644 --- a/tests/test_ingredient.py +++ b/tests/test_ingredient.py @@ -21,13 +21,16 @@ def test_ingredient_types(self): assert sauce.get_type() == "SAUCE" assert filling.get_type() == "FILLING" - def test_ingredient_price_is_numeric(self): - """Check that price works numerically""" - - ingredient = Ingredient(INGREDIENT_TYPE_SAUCE, "mayonnaise", 45.0) - assert ingredient.get_price() == 45.0 - - ingredient2 = Ingredient(INGREDIENT_TYPE_FILLING, "lettuce", 30) - - total = ingredient.get_price() + ingredient2.get_price() - assert total == 75.0 + def test_get_price_returns_correct_value(self): + """Проверка получения цены для конкретного ингредиента""" + price = 45.0 + ingredient = Ingredient(INGREDIENT_TYPE_SAUCE, "mayonnaise", price) + assert ingredient.get_price() == price + + def test_ingredient_prices_can_be_summed(self): + """Проверка, что цены ингредиентов можно складывать (они численного типа)""" + ingredient1 = Ingredient(INGREDIENT_TYPE_SAUCE, "mayonnaise", 45.0) + ingredient2 = Ingredient(INGREDIENT_TYPE_FILLING, "lettuce", 30.0) + + assert ingredient1.get_price() + ingredient2.get_price() == 75.0 + From 2b2919663c2eb6e2a0003e870ea5901a774a00c4 Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Sun, 28 Dec 2025 20:05:48 +0100 Subject: [PATCH 51/54] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=B0=D1=82=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_praktikum.py | 249 ++++++++++------------------------------ 1 file changed, 60 insertions(+), 189 deletions(-) diff --git a/tests/test_praktikum.py b/tests/test_praktikum.py index 46713e37e..23d0ed0d9 100644 --- a/tests/test_praktikum.py +++ b/tests/test_praktikum.py @@ -1,199 +1,70 @@ -""" -Тесты для главного модуля praktikum.py -""" import pytest from unittest.mock import Mock, patch, call from praktikum.praktikum import main - class TestPraktikum: - """Тестирование основного модуля программы""" - - @patch('praktikum.praktikum.print') # Мокаем print - @patch('praktikum.praktikum.Database') # Мокаем Database - def test_main_function_creates_burger_correctly(self, mock_database_class, mock_print): - """ - Тестирует, что функция main() правильно создает бургер: - 1. Создает базу данных - 2. Берет нужные булочки и ингредиенты - 3. Добавляет ингредиенты в правильном порядке - 4. Перемещает и удаляет ингредиенты - 5. Выводит правильный чек - """ - - mock_database_instance = Mock() - mock_database_class.return_value = mock_database_instance - - # Создаем моки для булочек - mock_buns = [Mock() for _ in range(3)] - mock_buns[0].get_name.return_value = "black bun" - mock_buns[0].get_price.return_value = 100.0 - - # Создаем моки для ингредиентов (6 штук) - mock_ingredients = [Mock() for _ in range(6)] - - # Настраиваем возвращаемые значения для ингредиентов - # Соусы (первые 3) - mock_ingredients[0].get_type.return_value = "SAUCE" - mock_ingredients[0].get_name.return_value = "hot sauce" - mock_ingredients[0].get_price.return_value = 100.0 - - mock_ingredients[1].get_type.return_value = "SAUCE" - mock_ingredients[1].get_name.return_value = "sour cream" - mock_ingredients[1].get_price.return_value = 200.0 - - mock_ingredients[2].get_type.return_value = "SAUCE" - mock_ingredients[2].get_name.return_value = "chili sauce" - mock_ingredients[2].get_price.return_value = 300.0 - - # Начинки (последние 3) - mock_ingredients[3].get_type.return_value = "FILLING" - mock_ingredients[3].get_name.return_value = "cutlet" - mock_ingredients[3].get_price.return_value = 100.0 - - mock_ingredients[4].get_type.return_value = "FILLING" - mock_ingredients[4].get_name.return_value = "dinosaur" - mock_ingredients[4].get_price.return_value = 200.0 - - mock_ingredients[5].get_type.return_value = "FILLING" - mock_ingredients[5].get_name.return_value = "sausage" - mock_ingredients[5].get_price.return_value = 300.0 - - # Настраиваем методы базы данных - mock_database_instance.available_buns.return_value = mock_buns - mock_database_instance.available_ingredients.return_value = mock_ingredients - - - main() - - - # 1.Проверяем создание Database - mock_database_class.assert_called_once() - - # 2. Проверяем вызовы методов базы данных - mock_database_instance.available_buns.assert_called_once() - mock_database_instance.available_ingredients.assert_called_once() - - # 3. Проверяем, что print был вызван - mock_print.assert_called_once() - - # 4. Получаем аргумент, с которым был вызван print - printed_receipt = mock_print.call_args[0][0] - - # 5. Проверяем содержимое чека - assert "(==== black bun ====)" in printed_receipt - assert "Price:" in printed_receipt - - @patch('praktikum.praktikum.print') - @patch('praktikum.praktikum.Database') - def test_main_uses_correct_indices_from_database(self, mock_database_class, mock_print): - """ - Проверяем, что main() использует правильные индексы из базы данных: - - buns[0] - первая булочка - - ingredients[1], [4], [3], [5] - конкретные ингредиенты - """ - - mock_database_instance = Mock() - mock_database_class.return_value = mock_database_instance - - # Создаем отслеживаемые моки - mock_buns = [Mock() for _ in range(3)] - mock_ingredients = [Mock() for _ in range(6)] - - # Создаем мок для Burger, чтобы отслеживать вызовы - with patch('praktikum.praktikum.Burger') as mock_burger_class: + """Тестирование основного модуля программы (функции main)""" + + @pytest.fixture + def mock_db_and_burger(self): + """Фикстура для настройки общего мока базы данных""" + with patch('praktikum.praktikum.Database') as mock_db_class, \ + patch('praktikum.praktikum.Burger') as mock_burger_class: + + mock_db_instance = Mock() + mock_db_class.return_value = mock_db_instance + mock_burger_instance = Mock() mock_burger_class.return_value = mock_burger_instance - - mock_database_instance.available_buns.return_value = mock_buns - mock_database_instance.available_ingredients.return_value = mock_ingredients - - # ===== ACT ===== - main() - - - # Проверяем вызовы методов Burger с правильными аргументами - mock_burger_instance.set_buns.assert_called_once_with(mock_buns[0]) - - # Проверяем добавление ингредиентов в правильном порядке - expected_add_calls = [ - call(mock_ingredients[1]), - call(mock_ingredients[4]), - call(mock_ingredients[3]), - call(mock_ingredients[5]) - ] - mock_burger_instance.add_ingredient.assert_has_calls(expected_add_calls) - - # Проверяем перемещение ингредиента - mock_burger_instance.move_ingredient.assert_called_once_with(2, 1) - - # Проверяем удаление ингредиента - mock_burger_instance.remove_ingredient.assert_called_once_with(3) - - # Проверяем вывод чека - mock_burger_instance.get_receipt.assert_called_once() - mock_print.assert_called_once_with(mock_burger_instance.get_receipt.return_value) - + + # Настройка минимально необходимых данных в БД + mock_buns = [Mock() for _ in range(3)] + mock_ingredients = [Mock() for _ in range(6)] + mock_db_instance.available_buns.return_value = mock_buns + mock_db_instance.available_ingredients.return_value = mock_ingredients + + yield mock_db_instance, mock_burger_instance + @patch('praktikum.praktikum.print') - @patch('praktikum.praktikum.Database') - def test_main_handles_empty_database(self, mock_database_class, mock_print): - """ - Тестируем обработку пустой базы данных - """ - - mock_database_instance = Mock() - mock_database_class.return_value = mock_database_instance - - # Пустые списки - mock_database_instance.available_buns.return_value = [] - mock_database_instance.available_ingredients.return_value = [] - - - # Должно вызвать IndexError при попытке обращения по индексу - with pytest.raises(IndexError): - main() - - def test_main_can_be_imported(self): - """ - Проверяем, что модуль можно импортировать без ошибок - """ - - from praktikum.praktikum import main - assert callable(main) - + def test_main_calls_database_methods(self, mock_print, mock_db_and_burger): + """Проверка, что main обращается к базе данных за булками и ингредиентами""" + mock_db_instance, _ = mock_db_and_burger + main() + mock_db_instance.available_buns.assert_called_once() + mock_db_instance.available_ingredients.assert_called_once() + @patch('praktikum.praktikum.print') - @patch('praktikum.praktikum.Database') - def test_main_price_calculation_integration(self, mock_database_class, mock_print): - """ - Интеграционный тест: проверяем правильность расчета цены - """ - - mock_database_instance = Mock() - mock_database_class.return_value = mock_database_instance - - # Настраиваем цены согласно коду из database.py - mock_buns = [Mock()] - mock_buns[0].get_name.return_value = "black bun" - mock_buns[0].get_price.return_value = 100.0 # black bun цена 100 - - # Создаем 6 ингредиентов как в database.py - mock_ingredients = [Mock() for _ in range(6)] - - # Соусы (индексы 0, 1, 2) - mock_ingredients[0].get_price.return_value = 100.0 # hot sauce - mock_ingredients[1].get_price.return_value = 200.0 # sour cream - mock_ingredients[2].get_price.return_value = 300.0 # chili sauce - - # Начинки (индексы 3, 4, 5) - mock_ingredients[3].get_price.return_value = 100.0 # cutlet - mock_ingredients[4].get_price.return_value = 200.0 # dinosaur - mock_ingredients[5].get_price.return_value = 300.0 # sausage - - mock_database_instance.available_buns.return_value = mock_buns - mock_database_instance.available_ingredients.return_value = mock_ingredients - - + def test_main_assembles_burger_with_correct_ingredients(self, mock_print, mock_db_and_burger): + """Проверка, что в бургер устанавливаются правильные компоненты из базы""" + mock_db_instance, mock_burger_instance = mock_db_and_burger + mock_buns = mock_db_instance.available_buns.return_value + mock_ingredients = mock_db_instance.available_ingredients.return_value + + main() + + # Проверяем установку булки (индекс 0) + mock_burger_instance.set_buns.assert_called_once_with(mock_buns[0]) + # Проверяем добавление ингредиентов (индексы 1, 4, 3, 5) + expected_calls = [call(mock_ingredients[1]), call(mock_ingredients[4]), + call(mock_ingredients[3]), call(mock_ingredients[5])] + mock_burger_instance.add_ingredient.assert_has_calls(expected_calls) + + @patch('praktikum.praktikum.print') + def test_main_modifies_burger_structure(self, mock_print, mock_db_and_burger): + """Проверка, что main вызывает методы перемещения и удаления ингредиентов""" + _, mock_burger_instance = mock_db_and_burger main() - - printed_receipt = mock_print.call_args[0][0] - assert "Price: 700" in printed_receipt + mock_burger_instance.move_ingredient.assert_called_once_with(2, 1) + mock_burger_instance.remove_ingredient.assert_called_once_with(3) + + @patch('praktikum.praktikum.print') + def test_main_prints_receipt(self, mock_print, mock_db_and_burger): + """Проверка, что main получает чек и выводит его в консоль""" + _, mock_burger_instance = mock_db_and_burger + mock_receipt = "Test Receipt" + mock_burger_instance.get_receipt.return_value = mock_receipt + + main() + + mock_burger_instance.get_receipt.assert_called_once() + mock_print.assert_called_once_with(mock_receipt) From 5d9d981bf3855ff2716f904c355212843be88ca7 Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Mon, 5 Jan 2026 21:16:23 +0100 Subject: [PATCH 52/54] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htmlcov/.gitignore | 2 - htmlcov/class_index.html | 195 ----- htmlcov/coverage_html_cb_497bf287.js | 733 ------------------ htmlcov/favicon_32_cb_58284776.png | Bin 1732 -> 0 bytes htmlcov/function_index.html | 307 -------- htmlcov/index.html | 153 ---- htmlcov/keybd_closed_cb_ce680311.png | Bin 9004 -> 0 bytes htmlcov/status.json | 1 - htmlcov/style_cb_dca529e9.css | 377 --------- htmlcov/z_c68eb0c7512457e4___init___py.html | 98 --- htmlcov/z_c68eb0c7512457e4_bun_py.html | 112 --- htmlcov/z_c68eb0c7512457e4_burger_py.html | 145 ---- htmlcov/z_c68eb0c7512457e4_database_py.html | 130 ---- htmlcov/z_c68eb0c7512457e4_ingredient_py.html | 117 --- ..._c68eb0c7512457e4_ingredient_types_py.html | 104 --- htmlcov/z_c68eb0c7512457e4_praktikum_py.html | 139 ---- tests/test_praktikum.py | 25 +- 17 files changed, 4 insertions(+), 2634 deletions(-) delete mode 100644 htmlcov/.gitignore delete mode 100644 htmlcov/class_index.html delete mode 100644 htmlcov/coverage_html_cb_497bf287.js delete mode 100644 htmlcov/favicon_32_cb_58284776.png delete mode 100644 htmlcov/function_index.html delete mode 100644 htmlcov/index.html delete mode 100644 htmlcov/keybd_closed_cb_ce680311.png delete mode 100644 htmlcov/status.json delete mode 100644 htmlcov/style_cb_dca529e9.css delete mode 100644 htmlcov/z_c68eb0c7512457e4___init___py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_bun_py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_burger_py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_database_py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html delete mode 100644 htmlcov/z_c68eb0c7512457e4_praktikum_py.html diff --git a/htmlcov/.gitignore b/htmlcov/.gitignore deleted file mode 100644 index ccccf1423..000000000 --- a/htmlcov/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Created by coverage.py -* diff --git a/htmlcov/class_index.html b/htmlcov/class_index.html deleted file mode 100644 index 97c531b48..000000000 --- a/htmlcov/class_index.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Coverage report - - - - - -
-
-

Coverage report: - 99% -

- -
- -
- - -
-
-

- Files - Functions - Classes -

-

- coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fileclassstatementsmissingexcludedcoverage
praktikum\__init__.py(no class)000100%
praktikum\bun.pyBun400100%
praktikum\bun.py(no class)400100%
praktikum\burger.pyBurger1600100%
praktikum\burger.py(no class)1100100%
praktikum\database.pyDatabase1300100%
praktikum\database.py(no class)800100%
praktikum\ingredient.pyIngredient600100%
praktikum\ingredient.py(no class)500100%
praktikum\ingredient_types.py(no class)200100%
praktikum\praktikum.py(no class)201095%
Total 891099%
-

- No items found using the specified filter. -

-
- - - diff --git a/htmlcov/coverage_html_cb_497bf287.js b/htmlcov/coverage_html_cb_497bf287.js deleted file mode 100644 index 1face13de..000000000 --- a/htmlcov/coverage_html_cb_497bf287.js +++ /dev/null @@ -1,733 +0,0 @@ -// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 -// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt - -// Coverage.py HTML report browser code. -/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ -/*global coverage: true, document, window, $ */ - -coverage = {}; - -// General helpers -function debounce(callback, wait) { - let timeoutId = null; - return function(...args) { - clearTimeout(timeoutId); - timeoutId = setTimeout(() => { - callback.apply(this, args); - }, wait); - }; -}; - -function checkVisible(element) { - const rect = element.getBoundingClientRect(); - const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); - const viewTop = 30; - return !(rect.bottom < viewTop || rect.top >= viewBottom); -} - -function on_click(sel, fn) { - const elt = document.querySelector(sel); - if (elt) { - elt.addEventListener("click", fn); - } -} - -// Helpers for table sorting -function getCellValue(row, column = 0) { - const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection - if (cell.childElementCount == 1) { - var child = cell.firstElementChild; - if (child.tagName === "A") { - child = child.firstElementChild; - } - if (child instanceof HTMLDataElement && child.value) { - return child.value; - } - } - return cell.innerText || cell.textContent; -} - -function rowComparator(rowA, rowB, column = 0) { - let valueA = getCellValue(rowA, column); - let valueB = getCellValue(rowB, column); - if (!isNaN(valueA) && !isNaN(valueB)) { - return valueA - valueB; - } - return valueA.localeCompare(valueB, undefined, {numeric: true}); -} - -function sortColumn(th) { - // Get the current sorting direction of the selected header, - // clear state on other headers and then set the new sorting direction. - const currentSortOrder = th.getAttribute("aria-sort"); - [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); - var direction; - if (currentSortOrder === "none") { - direction = th.dataset.defaultSortOrder || "ascending"; - } - else if (currentSortOrder === "ascending") { - direction = "descending"; - } - else { - direction = "ascending"; - } - th.setAttribute("aria-sort", direction); - - const column = [...th.parentElement.cells].indexOf(th) - - // Sort all rows and afterwards append them in order to move them in the DOM. - Array.from(th.closest("table").querySelectorAll("tbody tr")) - .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (direction === "ascending" ? 1 : -1)) - .forEach(tr => tr.parentElement.appendChild(tr)); - - // Save the sort order for next time. - if (th.id !== "region") { - let th_id = "file"; // Sort by file if we don't have a column id - let current_direction = direction; - const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); - if (stored_list) { - ({th_id, direction} = JSON.parse(stored_list)) - } - localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ - "th_id": th.id, - "direction": current_direction - })); - if (th.id !== th_id || document.getElementById("region")) { - // Sort column has changed, unset sorting by function or class. - localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ - "by_region": false, - "region_direction": current_direction - })); - } - } - else { - // Sort column has changed to by function or class, remember that. - localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ - "by_region": true, - "region_direction": direction - })); - } -} - -// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. -coverage.assign_shortkeys = function () { - document.querySelectorAll("[data-shortcut]").forEach(element => { - document.addEventListener("keypress", event => { - if (event.target.tagName.toLowerCase() === "input") { - return; // ignore keypress from search filter - } - if (event.key === element.dataset.shortcut) { - element.click(); - } - }); - }); -}; - -// Create the events for the filter box. -coverage.wire_up_filter = function () { - // Populate the filter and hide100 inputs if there are saved values for them. - const saved_filter_value = localStorage.getItem(coverage.FILTER_STORAGE); - if (saved_filter_value) { - document.getElementById("filter").value = saved_filter_value; - } - const saved_hide100_value = localStorage.getItem(coverage.HIDE100_STORAGE); - if (saved_hide100_value) { - document.getElementById("hide100").checked = JSON.parse(saved_hide100_value); - } - - // Cache elements. - const table = document.querySelector("table.index"); - const table_body_rows = table.querySelectorAll("tbody tr"); - const no_rows = document.getElementById("no_rows"); - - // Observe filter keyevents. - const filter_handler = (event => { - // Keep running total of each metric, first index contains number of shown rows - const totals = new Array(table.rows[0].cells.length).fill(0); - // Accumulate the percentage as fraction - totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection - - var text = document.getElementById("filter").value; - // Store filter value - localStorage.setItem(coverage.FILTER_STORAGE, text); - const casefold = (text === text.toLowerCase()); - const hide100 = document.getElementById("hide100").checked; - // Store hide value. - localStorage.setItem(coverage.HIDE100_STORAGE, JSON.stringify(hide100)); - - // Hide / show elements. - table_body_rows.forEach(row => { - var show = false; - // Check the text filter. - for (let column = 0; column < totals.length; column++) { - cell = row.cells[column]; - if (cell.classList.contains("name")) { - var celltext = cell.textContent; - if (casefold) { - celltext = celltext.toLowerCase(); - } - if (celltext.includes(text)) { - show = true; - } - } - } - - // Check the "hide covered" filter. - if (show && hide100) { - const [numer, denom] = row.cells[row.cells.length - 1].dataset.ratio.split(" "); - show = (numer !== denom); - } - - if (!show) { - // hide - row.classList.add("hidden"); - return; - } - - // show - row.classList.remove("hidden"); - totals[0]++; - - for (let column = 0; column < totals.length; column++) { - // Accumulate dynamic totals - cell = row.cells[column] // nosemgrep: eslint.detect-object-injection - if (cell.classList.contains("name")) { - continue; - } - if (column === totals.length - 1) { - // Last column contains percentage - const [numer, denom] = cell.dataset.ratio.split(" "); - totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection - totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection - } - else { - totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection - } - } - }); - - // Show placeholder if no rows will be displayed. - if (!totals[0]) { - // Show placeholder, hide table. - no_rows.style.display = "block"; - table.style.display = "none"; - return; - } - - // Hide placeholder, show table. - no_rows.style.display = null; - table.style.display = null; - - const footer = table.tFoot.rows[0]; - // Calculate new dynamic sum values based on visible rows. - for (let column = 0; column < totals.length; column++) { - // Get footer cell element. - const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection - if (cell.classList.contains("name")) { - continue; - } - - // Set value into dynamic footer cell element. - if (column === totals.length - 1) { - // Percentage column uses the numerator and denominator, - // and adapts to the number of decimal places. - const match = /\.([0-9]+)/.exec(cell.textContent); - const places = match ? match[1].length : 0; - const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection - cell.dataset.ratio = `${numer} ${denom}`; - // Check denom to prevent NaN if filtered files contain no statements - cell.textContent = denom - ? `${(numer * 100 / denom).toFixed(places)}%` - : `${(100).toFixed(places)}%`; - } - else { - cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection - } - } - }); - - document.getElementById("filter").addEventListener("input", debounce(filter_handler)); - document.getElementById("hide100").addEventListener("input", debounce(filter_handler)); - - // Trigger change event on setup, to force filter on page refresh - // (filter value may still be present). - document.getElementById("filter").dispatchEvent(new Event("input")); - document.getElementById("hide100").dispatchEvent(new Event("input")); -}; -coverage.FILTER_STORAGE = "COVERAGE_FILTER_VALUE"; -coverage.HIDE100_STORAGE = "COVERAGE_HIDE100_VALUE"; - -// Set up the click-to-sort columns. -coverage.wire_up_sorting = function () { - document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( - th => th.addEventListener("click", e => sortColumn(e.target)) - ); - - // Look for a localStorage item containing previous sort settings: - let th_id = "file", direction = "ascending"; - const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); - if (stored_list) { - ({th_id, direction} = JSON.parse(stored_list)); - } - let by_region = false, region_direction = "ascending"; - const sorted_by_region = localStorage.getItem(coverage.SORTED_BY_REGION); - if (sorted_by_region) { - ({ - by_region, - region_direction - } = JSON.parse(sorted_by_region)); - } - - const region_id = "region"; - if (by_region && document.getElementById(region_id)) { - direction = region_direction; - } - // If we are in a page that has a column with id of "region", sort on - // it if the last sort was by function or class. - let th; - if (document.getElementById(region_id)) { - th = document.getElementById(by_region ? region_id : th_id); - } - else { - th = document.getElementById(th_id); - } - th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); - th.click() -}; - -coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; -coverage.SORTED_BY_REGION = "COVERAGE_SORT_REGION"; - -// Loaded on index.html -coverage.index_ready = function () { - coverage.assign_shortkeys(); - coverage.wire_up_filter(); - coverage.wire_up_sorting(); - - on_click(".button_prev_file", coverage.to_prev_file); - on_click(".button_next_file", coverage.to_next_file); - - on_click(".button_show_hide_help", coverage.show_hide_help); -}; - -// -- pyfile stuff -- - -coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; - -coverage.pyfile_ready = function () { - // If we're directed to a particular line number, highlight the line. - var frag = location.hash; - if (frag.length > 2 && frag[1] === "t") { - document.querySelector(frag).closest(".n").classList.add("highlight"); - coverage.set_sel(parseInt(frag.substr(2), 10)); - } - else { - coverage.set_sel(0); - } - - on_click(".button_toggle_run", coverage.toggle_lines); - on_click(".button_toggle_mis", coverage.toggle_lines); - on_click(".button_toggle_exc", coverage.toggle_lines); - on_click(".button_toggle_par", coverage.toggle_lines); - - on_click(".button_next_chunk", coverage.to_next_chunk_nicely); - on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); - on_click(".button_top_of_page", coverage.to_top); - on_click(".button_first_chunk", coverage.to_first_chunk); - - on_click(".button_prev_file", coverage.to_prev_file); - on_click(".button_next_file", coverage.to_next_file); - on_click(".button_to_index", coverage.to_index); - - on_click(".button_show_hide_help", coverage.show_hide_help); - - coverage.filters = undefined; - try { - coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); - } catch(err) {} - - if (coverage.filters) { - coverage.filters = JSON.parse(coverage.filters); - } - else { - coverage.filters = {run: false, exc: true, mis: true, par: true}; - } - - for (cls in coverage.filters) { - coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection - } - - coverage.assign_shortkeys(); - coverage.init_scroll_markers(); - coverage.wire_up_sticky_header(); - - document.querySelectorAll("[id^=ctxs]").forEach( - cbox => cbox.addEventListener("click", coverage.expand_contexts) - ); - - // Rebuild scroll markers when the window height changes. - window.addEventListener("resize", coverage.build_scroll_markers); -}; - -coverage.toggle_lines = function (event) { - const btn = event.target.closest("button"); - const category = btn.value - const show = !btn.classList.contains("show_" + category); - coverage.set_line_visibilty(category, show); - coverage.build_scroll_markers(); - coverage.filters[category] = show; - try { - localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); - } catch(err) {} -}; - -coverage.set_line_visibilty = function (category, should_show) { - const cls = "show_" + category; - const btn = document.querySelector(".button_toggle_" + category); - if (btn) { - if (should_show) { - document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); - btn.classList.add(cls); - } - else { - document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); - btn.classList.remove(cls); - } - } -}; - -// Return the nth line div. -coverage.line_elt = function (n) { - return document.getElementById("t" + n)?.closest("p"); -}; - -// Set the selection. b and e are line numbers. -coverage.set_sel = function (b, e) { - // The first line selected. - coverage.sel_begin = b; - // The next line not selected. - coverage.sel_end = (e === undefined) ? b+1 : e; -}; - -coverage.to_top = function () { - coverage.set_sel(0, 1); - coverage.scroll_window(0); -}; - -coverage.to_first_chunk = function () { - coverage.set_sel(0, 1); - coverage.to_next_chunk(); -}; - -coverage.to_prev_file = function () { - window.location = document.getElementById("prevFileLink").href; -} - -coverage.to_next_file = function () { - window.location = document.getElementById("nextFileLink").href; -} - -coverage.to_index = function () { - location.href = document.getElementById("indexLink").href; -} - -coverage.show_hide_help = function () { - const helpCheck = document.getElementById("help_panel_state") - helpCheck.checked = !helpCheck.checked; -} - -// Return a string indicating what kind of chunk this line belongs to, -// or null if not a chunk. -coverage.chunk_indicator = function (line_elt) { - const classes = line_elt?.className; - if (!classes) { - return null; - } - const match = classes.match(/\bshow_\w+\b/); - if (!match) { - return null; - } - return match[0]; -}; - -coverage.to_next_chunk = function () { - const c = coverage; - - // Find the start of the next colored chunk. - var probe = c.sel_end; - var chunk_indicator, probe_line; - while (true) { - probe_line = c.line_elt(probe); - if (!probe_line) { - return; - } - chunk_indicator = c.chunk_indicator(probe_line); - if (chunk_indicator) { - break; - } - probe++; - } - - // There's a next chunk, `probe` points to it. - var begin = probe; - - // Find the end of this chunk. - var next_indicator = chunk_indicator; - while (next_indicator === chunk_indicator) { - probe++; - probe_line = c.line_elt(probe); - next_indicator = c.chunk_indicator(probe_line); - } - c.set_sel(begin, probe); - c.show_selection(); -}; - -coverage.to_prev_chunk = function () { - const c = coverage; - - // Find the end of the prev colored chunk. - var probe = c.sel_begin-1; - var probe_line = c.line_elt(probe); - if (!probe_line) { - return; - } - var chunk_indicator = c.chunk_indicator(probe_line); - while (probe > 1 && !chunk_indicator) { - probe--; - probe_line = c.line_elt(probe); - if (!probe_line) { - return; - } - chunk_indicator = c.chunk_indicator(probe_line); - } - - // There's a prev chunk, `probe` points to its last line. - var end = probe+1; - - // Find the beginning of this chunk. - var prev_indicator = chunk_indicator; - while (prev_indicator === chunk_indicator) { - probe--; - if (probe <= 0) { - return; - } - probe_line = c.line_elt(probe); - prev_indicator = c.chunk_indicator(probe_line); - } - c.set_sel(probe+1, end); - c.show_selection(); -}; - -// Returns 0, 1, or 2: how many of the two ends of the selection are on -// the screen right now? -coverage.selection_ends_on_screen = function () { - if (coverage.sel_begin === 0) { - return 0; - } - - const begin = coverage.line_elt(coverage.sel_begin); - const end = coverage.line_elt(coverage.sel_end-1); - - return ( - (checkVisible(begin) ? 1 : 0) - + (checkVisible(end) ? 1 : 0) - ); -}; - -coverage.to_next_chunk_nicely = function () { - if (coverage.selection_ends_on_screen() === 0) { - // The selection is entirely off the screen: - // Set the top line on the screen as selection. - - // This will select the top-left of the viewport - // As this is most likely the span with the line number we take the parent - const line = document.elementFromPoint(0, 0).parentElement; - if (line.parentElement !== document.getElementById("source")) { - // The element is not a source line but the header or similar - coverage.select_line_or_chunk(1); - } - else { - // We extract the line number from the id - coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); - } - } - coverage.to_next_chunk(); -}; - -coverage.to_prev_chunk_nicely = function () { - if (coverage.selection_ends_on_screen() === 0) { - // The selection is entirely off the screen: - // Set the lowest line on the screen as selection. - - // This will select the bottom-left of the viewport - // As this is most likely the span with the line number we take the parent - const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; - if (line.parentElement !== document.getElementById("source")) { - // The element is not a source line but the header or similar - coverage.select_line_or_chunk(coverage.lines_len); - } - else { - // We extract the line number from the id - coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); - } - } - coverage.to_prev_chunk(); -}; - -// Select line number lineno, or if it is in a colored chunk, select the -// entire chunk -coverage.select_line_or_chunk = function (lineno) { - var c = coverage; - var probe_line = c.line_elt(lineno); - if (!probe_line) { - return; - } - var the_indicator = c.chunk_indicator(probe_line); - if (the_indicator) { - // The line is in a highlighted chunk. - // Search backward for the first line. - var probe = lineno; - var indicator = the_indicator; - while (probe > 0 && indicator === the_indicator) { - probe--; - probe_line = c.line_elt(probe); - if (!probe_line) { - break; - } - indicator = c.chunk_indicator(probe_line); - } - var begin = probe + 1; - - // Search forward for the last line. - probe = lineno; - indicator = the_indicator; - while (indicator === the_indicator) { - probe++; - probe_line = c.line_elt(probe); - indicator = c.chunk_indicator(probe_line); - } - - coverage.set_sel(begin, probe); - } - else { - coverage.set_sel(lineno); - } -}; - -coverage.show_selection = function () { - // Highlight the lines in the chunk - document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); - for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { - coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); - } - - coverage.scroll_to_selection(); -}; - -coverage.scroll_to_selection = function () { - // Scroll the page if the chunk isn't fully visible. - if (coverage.selection_ends_on_screen() < 2) { - const element = coverage.line_elt(coverage.sel_begin); - coverage.scroll_window(element.offsetTop - 60); - } -}; - -coverage.scroll_window = function (to_pos) { - window.scroll({top: to_pos, behavior: "smooth"}); -}; - -coverage.init_scroll_markers = function () { - // Init some variables - coverage.lines_len = document.querySelectorAll("#source > p").length; - - // Build html - coverage.build_scroll_markers(); -}; - -coverage.build_scroll_markers = function () { - const temp_scroll_marker = document.getElementById("scroll_marker") - if (temp_scroll_marker) temp_scroll_marker.remove(); - // Don't build markers if the window has no scroll bar. - if (document.body.scrollHeight <= window.innerHeight) { - return; - } - - const marker_scale = window.innerHeight / document.body.scrollHeight; - const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); - - let previous_line = -99, last_mark, last_top; - - const scroll_marker = document.createElement("div"); - scroll_marker.id = "scroll_marker"; - document.getElementById("source").querySelectorAll( - "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" - ).forEach(element => { - const line_top = Math.floor(element.offsetTop * marker_scale); - const line_number = parseInt(element.querySelector(".n a").id.substr(1)); - - if (line_number === previous_line + 1) { - // If this solid missed block just make previous mark higher. - last_mark.style.height = `${line_top + line_height - last_top}px`; - } - else { - // Add colored line in scroll_marker block. - last_mark = document.createElement("div"); - last_mark.id = `m${line_number}`; - last_mark.classList.add("marker"); - last_mark.style.height = `${line_height}px`; - last_mark.style.top = `${line_top}px`; - scroll_marker.append(last_mark); - last_top = line_top; - } - - previous_line = line_number; - }); - - // Append last to prevent layout calculation - document.body.append(scroll_marker); -}; - -coverage.wire_up_sticky_header = function () { - const header = document.querySelector("header"); - const header_bottom = ( - header.querySelector(".content h2").getBoundingClientRect().top - - header.getBoundingClientRect().top - ); - - function updateHeader() { - if (window.scrollY > header_bottom) { - header.classList.add("sticky"); - } - else { - header.classList.remove("sticky"); - } - } - - window.addEventListener("scroll", updateHeader); - updateHeader(); -}; - -coverage.expand_contexts = function (e) { - var ctxs = e.target.parentNode.querySelector(".ctxs"); - - if (!ctxs.classList.contains("expanded")) { - var ctxs_text = ctxs.textContent; - var width = Number(ctxs_text[0]); - ctxs.textContent = ""; - for (var i = 1; i < ctxs_text.length; i += width) { - key = ctxs_text.substring(i, i + width).trim(); - ctxs.appendChild(document.createTextNode(contexts[key])); - ctxs.appendChild(document.createElement("br")); - } - ctxs.classList.add("expanded"); - } -}; - -document.addEventListener("DOMContentLoaded", () => { - if (document.body.classList.contains("indexfile")) { - coverage.index_ready(); - } - else { - coverage.pyfile_ready(); - } -}); diff --git a/htmlcov/favicon_32_cb_58284776.png b/htmlcov/favicon_32_cb_58284776.png deleted file mode 100644 index 8649f0475d8d20793b2ec431fe25a186a414cf10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1732 zcmV;#20QtQP)K2KOkBOVxIZChq#W-v7@TU%U6P(wycKT1hUJUToW3ke1U1ONa4 z000000000000000bb)GRa9mqwR9|UWHy;^RUrt?IT__Y0JUcxmBP0(51q1>E00030 z|NrOz)aw7%8sJzM<5^g%z7^qE`}_Ot|JUUG(NUkWzR|7K?Zo%@_v-8G-1N%N=D$;; zw;keH4dGY$`1t4M=HK_s*zm^0#KgqfwWhe3qO_HtvXYvtjgX>;-~C$L`&k>^R)9)7 zdPh2TL^pCnHC#0+_4D)M`p?qp!pq{jO_{8;$fbaflbx`Tn52n|n}8VFRTA1&ugOP< zPd{uvFjz7t*Vot1&d$l-xWCk}s;sQL&#O(Bskh6gqNJv>#iB=ypG1e3K!K4yc7!~M zfj4S*g^zZ7eP$+_Sl07Z646l;%urinP#D8a6TwRtnLIRcI!r4f@bK~9-`~;E(N?Lv zSEst7s;rcxsi~}{Nsytfz@MtUoR*iFc8!#vvx}Umhm4blk(_~MdVD-@dW&>!Nn~ro z_E~-ESV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>s;wCa zm^)spe{uxGFmrJYI9cOh7s$>8Npkt-5EWB1UKc`{W{y5Ce$1+nM9Cr;);=Ju#N^62OSlJMn7omiUgP&ErsYzT~iGxcW aE(`!K@+CXylaC4j0000 - - - - Coverage report - - - - - -
-
-

Coverage report: - 99% -

- -
- -
- - -
-
-

- Files - Functions - Classes -

-

- coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Filefunctionstatementsmissingexcludedcoverage
praktikum\__init__.py(no function)000100%
praktikum\bun.pyBun.__init__200100%
praktikum\bun.pyBun.get_name100100%
praktikum\bun.pyBun.get_price100100%
praktikum\bun.py(no function)400100%
praktikum\burger.pyBurger.__init__200100%
praktikum\burger.pyBurger.set_buns100100%
praktikum\burger.pyBurger.add_ingredient100100%
praktikum\burger.pyBurger.remove_ingredient100100%
praktikum\burger.pyBurger.move_ingredient100100%
praktikum\burger.pyBurger.get_price400100%
praktikum\burger.pyBurger.get_receipt600100%
praktikum\burger.py(no function)1100100%
praktikum\database.pyDatabase.__init__1100100%
praktikum\database.pyDatabase.available_buns100100%
praktikum\database.pyDatabase.available_ingredients100100%
praktikum\database.py(no function)800100%
praktikum\ingredient.pyIngredient.__init__300100%
praktikum\ingredient.pyIngredient.get_price100100%
praktikum\ingredient.pyIngredient.get_name100100%
praktikum\ingredient.pyIngredient.get_type100100%
praktikum\ingredient.py(no function)500100%
praktikum\ingredient_types.py(no function)200100%
praktikum\praktikum.pymain1200100%
praktikum\praktikum.py(no function)81088%
Total 891099%
-

- No items found using the specified filter. -

-
- - - diff --git a/htmlcov/index.html b/htmlcov/index.html deleted file mode 100644 index af6baea00..000000000 --- a/htmlcov/index.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - Coverage report - - - - - -
-
-

Coverage report: - 99% -

- -
- -
- - -
-
-

- Files - Functions - Classes -

-

- coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Filestatementsmissingexcludedcoverage
praktikum\__init__.py000100%
praktikum\bun.py800100%
praktikum\burger.py2700100%
praktikum\database.py2100100%
praktikum\ingredient.py1100100%
praktikum\ingredient_types.py200100%
praktikum\praktikum.py201095%
Total891099%
-

- No items found using the specified filter. -

-
- - - diff --git a/htmlcov/keybd_closed_cb_ce680311.png b/htmlcov/keybd_closed_cb_ce680311.png deleted file mode 100644 index ba119c47df81ed2bbd27a06988abf700139c4f99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9004 zcmeHLc{tSF+aIY=A^R4_poB4tZAN2XC;O7M(inrW3}(h&Q4}dl*&-65$i9^&vW6_# zcM4g`Qix=GhkBl;=lwnJ@Ap2}^}hc-b6vBXb3XUyzR%~}_c`-Dw+!?&>5p(90RRB> zXe~7($~PP3eT?=X<@3~Q1w84vX~IoSx~1#~02+TopXK(db;4v6!{+W`RHLkkHO zo;+s?)puc`+$yOwHv>I$5^8v^F3<|$44HA8AFnFB0cAP|C`p}aSMJK*-CUB{eQ!;K z-9Ju3OQ+xVPr3P#o4>_lNBT;M+1vgV&B~6!naOGHb-LFA9TkfHv1IFA1Y!Iz!Zl3) z%c#-^zNWPq7U_}6I7aHSmFWi125RZrNBKyvnV^?64)zviS;E!UD%LaGRl6@zn!3E{ zJ`B$5``cH_3a)t1#6I7d==JeB_IcSU%=I#DrRCBGm8GvCmA=+XHEvC2SIfsNa0(h9 z7P^C4U`W@@`9p>2f^zyb5B=lpc*RZMn-%%Iqr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%(*jf5H$*S)8;i0xWHdl>$p);nH9v0)YfW?Vz$! zNCeUbi9`NEg(i^57y=fzM@1o*z*Bf6?QCV>2p9}(BLlYsOCfMjFv1pw1mlo)Py{8v zppw{MDfEeWN+n>Ne~oI7%9cU}mz0r3!es2gNF0t5jkGipjIo2lz;-e)7}Ul_#!eDv zw;#>kI>;#-pyfeu3Fsd^2F@6=oh#8r9;A!G0`-mm7%{=S;Ec(bJ=I_`FodKGQVNEY zmXwr4{9*jpDl%4{ggQZ5Ac z%wYTdl*!1c5^)%^E78Q&)ma|27c6j(a=)g4sGrp$r{jv>>M2 z6y)E5|Aooe!PSfKzvKA>`a6pfK3=E8vL14ksP&f=>gOP?}rG6ye@9ZR3 zJF*vsh*P$w390i!FV~~_Hv6t2Zl<4VUi|rNja#boFt{%q~xGb z(2petq9A*_>~B*>?d?Olx^lmYg4)}sH2>G42RE; diff --git a/htmlcov/status.json b/htmlcov/status.json deleted file mode 100644 index e09334d56..000000000 --- a/htmlcov/status.json +++ /dev/null @@ -1 +0,0 @@ -{"note":"This file is an internal implementation detail to speed up HTML report generation. Its format can change at any time. You might be looking for the JSON report: https://coverage.rtfd.io/cmd.html#cmd-json","format":5,"version":"7.11.0","globals":"37549cb6f10abc1cc097c51bdc6b860d","files":{"z_c68eb0c7512457e4___init___py":{"hash":"bd020ce57c982120e8c32a91267d330d","index":{"url":"z_c68eb0c7512457e4___init___py.html","file":"praktikum\\__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_bun_py":{"hash":"820fa7fb820fb46cf300dac8d31b6bd0","index":{"url":"z_c68eb0c7512457e4_bun_py.html","file":"praktikum\\bun.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":8,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_burger_py":{"hash":"facdb0a5be4ca4a1f2f321d5a2d8fb87","index":{"url":"z_c68eb0c7512457e4_burger_py.html","file":"praktikum\\burger.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":27,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_database_py":{"hash":"30732bb755a2f38ad46148435b66601a","index":{"url":"z_c68eb0c7512457e4_database_py.html","file":"praktikum\\database.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":21,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_py":{"hash":"d1fcf36fcdce67a9051fb6dc31d4fcd0","index":{"url":"z_c68eb0c7512457e4_ingredient_py.html","file":"praktikum\\ingredient.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":11,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_types_py":{"hash":"2bcd1d2d9846c4979e7b61455ec13758","index":{"url":"z_c68eb0c7512457e4_ingredient_types_py.html","file":"praktikum\\ingredient_types.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":2,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_praktikum_py":{"hash":"7678957e5e3cc7b8263bb309fbd85bc3","index":{"url":"z_c68eb0c7512457e4_praktikum_py.html","file":"praktikum\\praktikum.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":20,"n_excluded":0,"n_missing":1,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}}}} \ No newline at end of file diff --git a/htmlcov/style_cb_dca529e9.css b/htmlcov/style_cb_dca529e9.css deleted file mode 100644 index 4735f2702..000000000 --- a/htmlcov/style_cb_dca529e9.css +++ /dev/null @@ -1,377 +0,0 @@ -@charset "UTF-8"; -/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ -/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ -/* Don't edit this .css file. Edit the .scss file instead! */ -html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } - -body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } - -@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } - -@media (prefers-color-scheme: dark) { body { color: #eee; } } - -html > body { font-size: 16px; } - -a:active, a:focus { outline: 2px dashed #007acc; } - -p { font-size: .875em; line-height: 1.4em; } - -table { border-collapse: collapse; } - -td { vertical-align: top; } - -table tr.hidden { display: none !important; } - -p#no_rows { display: none; font-size: 1.15em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } - -a.nav { text-decoration: none; color: inherit; } - -a.nav:hover { text-decoration: underline; color: inherit; } - -.hidden { display: none; } - -header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } - -@media (prefers-color-scheme: dark) { header { background: black; } } - -@media (prefers-color-scheme: dark) { header { border-color: #333; } } - -header .content { padding: 1rem 3.5rem; } - -header h2 { margin-top: .5em; font-size: 1em; } - -header h2 a.button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } - -@media (prefers-color-scheme: dark) { header h2 a.button { background: #333; } } - -@media (prefers-color-scheme: dark) { header h2 a.button { border-color: #444; } } - -header h2 a.button.current { border: 2px solid; background: #fff; border-color: #999; cursor: default; } - -@media (prefers-color-scheme: dark) { header h2 a.button.current { background: #1e1e1e; } } - -@media (prefers-color-scheme: dark) { header h2 a.button.current { border-color: #777; } } - -header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } - -@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } - -header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } - -header.sticky .text { display: none; } - -header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } - -header.sticky .content { padding: 0.5rem 3.5rem; } - -header.sticky .content p { font-size: 1em; } - -header.sticky ~ #source { padding-top: 6.5em; } - -main { position: relative; z-index: 1; } - -footer { margin: 1rem 3.5rem; } - -footer .content { padding: 0; color: #666; font-style: italic; } - -@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } - -#index { margin: 1rem 0 0 3.5rem; } - -h1 { font-size: 1.25em; display: inline-block; } - -#filter_container { float: right; margin: 0 2em 0 0; line-height: 1.66em; } - -#filter_container #filter { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } - -@media (prefers-color-scheme: dark) { #filter_container #filter { border-color: #444; } } - -@media (prefers-color-scheme: dark) { #filter_container #filter { background: #1e1e1e; } } - -@media (prefers-color-scheme: dark) { #filter_container #filter { color: #eee; } } - -#filter_container #filter:focus { border-color: #007acc; } - -#filter_container :disabled ~ label { color: #ccc; } - -@media (prefers-color-scheme: dark) { #filter_container :disabled ~ label { color: #444; } } - -#filter_container label { font-size: .875em; color: #666; } - -@media (prefers-color-scheme: dark) { #filter_container label { color: #aaa; } } - -header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } - -@media (prefers-color-scheme: dark) { header button { background: #333; } } - -@media (prefers-color-scheme: dark) { header button { border-color: #444; } } - -header button:active, header button:focus { outline: 2px dashed #007acc; } - -header button.run { background: #eeffee; } - -@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } - -header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } - -@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } - -header button.mis { background: #ffeeee; } - -@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } - -header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } - -@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } - -header button.exc { background: #f7f7f7; } - -@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } - -header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } - -@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } - -header button.par { background: #ffffd5; } - -@media (prefers-color-scheme: dark) { header button.par { background: #650; } } - -header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } - -@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } - -#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } - -#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } - -#help_panel_wrapper { float: right; position: relative; } - -#keyboard_icon { margin: 5px; } - -#help_panel_state { display: none; } - -#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } - -#help_panel .keyhelp p { margin-top: .75em; } - -#help_panel .legend { font-style: italic; margin-bottom: 1em; } - -.indexfile #help_panel { width: 25em; } - -.pyfile #help_panel { width: 18em; } - -#help_panel_state:checked ~ #help_panel { display: block; } - -kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } - -#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } - -#source p { position: relative; white-space: pre; } - -#source p * { box-sizing: border-box; } - -#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; user-select: none; } - -@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } - -#source p .n.highlight { background: #ffdd00; } - -#source p .n a { scroll-margin-top: 6em; text-decoration: none; color: #999; } - -@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } - -#source p .n a:hover { text-decoration: underline; color: #999; } - -@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } - -#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } - -@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } - -#source p .t:hover { background: #f2f2f2; } - -@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } - -#source p .t:hover ~ .r .annotate.long { display: block; } - -#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } - -@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } - -#source p .t .key { font-weight: bold; line-height: 1px; } - -#source p .t .str, #source p .t .fst { color: #0451a5; } - -@media (prefers-color-scheme: dark) { #source p .t .str, #source p .t .fst { color: #9cdcfe; } } - -#source p.mis .t { border-left: 0.2em solid #ff0000; } - -#source p.mis.show_mis .t { background: #fdd; } - -@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } - -#source p.mis.show_mis .t:hover { background: #f2d2d2; } - -@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } - -#source p.mis.mis2 .t { border-left: 0.2em dotted #ff0000; } - -#source p.mis.mis2.show_mis .t { background: #ffeeee; } - -@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t { background: #351b1b; } } - -#source p.mis.mis2.show_mis .t:hover { background: #f2d2d2; } - -@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t:hover { background: #532323; } } - -#source p.run .t { border-left: 0.2em solid #00dd00; } - -#source p.run.show_run .t { background: #dfd; } - -@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } - -#source p.run.show_run .t:hover { background: #d2f2d2; } - -@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } - -#source p.run.run2 .t { border-left: 0.2em dotted #00dd00; } - -#source p.run.run2.show_run .t { background: #eeffee; } - -@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t { background: #2b2e24; } } - -#source p.run.run2.show_run .t:hover { background: #d2f2d2; } - -@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t:hover { background: #404633; } } - -#source p.exc .t { border-left: 0.2em solid #808080; } - -#source p.exc.show_exc .t { background: #eee; } - -@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } - -#source p.exc.show_exc .t:hover { background: #e2e2e2; } - -@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } - -#source p.exc.exc2 .t { border-left: 0.2em dotted #808080; } - -#source p.exc.exc2.show_exc .t { background: #f7f7f7; } - -@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t { background: #292929; } } - -#source p.exc.exc2.show_exc .t:hover { background: #e2e2e2; } - -@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t:hover { background: #3c3c3c; } } - -#source p.par .t { border-left: 0.2em solid #bbbb00; } - -#source p.par.show_par .t { background: #ffa; } - -@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } - -#source p.par.show_par .t:hover { background: #f2f2a2; } - -@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } - -#source p.par.par2 .t { border-left: 0.2em dotted #bbbb00; } - -#source p.par.par2.show_par .t { background: #ffffd5; } - -@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t { background: #423a0f; } } - -#source p.par.par2.show_par .t:hover { background: #f2f2a2; } - -@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t:hover { background: #6d5d0c; } } - -#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } - -#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } - -@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } - -#source p .annotate.short:hover ~ .long { display: block; } - -#source p .annotate.long { width: 30em; right: 2.5em; } - -#source p input { display: none; } - -#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } - -#source p input ~ .r label.ctx::before { content: "▶ "; } - -#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } - -@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } - -@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } - -#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } - -@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } - -@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } - -#source p input:checked ~ .r label.ctx::before { content: "▼ "; } - -#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } - -#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } - -@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } - -#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } - -@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } - -#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } - -#index table.index { margin-left: -.5em; } - -#index td, #index th { text-align: right; padding: .25em .5em; border-bottom: 1px solid #eee; } - -@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } - -#index td.name, #index th.name { text-align: left; width: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; min-width: 15em; } - -#index th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-style: italic; color: #333; cursor: pointer; } - -@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } - -#index th:hover { background: #eee; } - -@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } - -#index th .arrows { color: #666; font-size: 85%; font-family: sans-serif; font-style: normal; pointer-events: none; } - -#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } - -@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } - -#index th[aria-sort="ascending"] .arrows::after { content: " ▲"; } - -#index th[aria-sort="descending"] .arrows::after { content: " ▼"; } - -#index td.name { font-size: 1.15em; } - -#index td.name a { text-decoration: none; color: inherit; } - -#index td.name .no-noun { font-style: italic; } - -#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } - -#index tr.region:hover { background: #eee; } - -@media (prefers-color-scheme: dark) { #index tr.region:hover { background: #333; } } - -#index tr.region:hover td.name { text-decoration: underline; color: inherit; } - -#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } - -@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } - -@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } - -#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } - -@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/htmlcov/z_c68eb0c7512457e4___init___py.html b/htmlcov/z_c68eb0c7512457e4___init___py.html deleted file mode 100644 index 55c255a59..000000000 --- a/htmlcov/z_c68eb0c7512457e4___init___py.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Coverage for praktikum\__init__.py: 100% - - - - - -
-
-

- Coverage for praktikum\__init__.py: - 100% -

- -

- 0 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_bun_py.html b/htmlcov/z_c68eb0c7512457e4_bun_py.html deleted file mode 100644 index a76e57dfb..000000000 --- a/htmlcov/z_c68eb0c7512457e4_bun_py.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - Coverage for praktikum\bun.py: 100% - - - - - -
-
-

- Coverage for praktikum\bun.py: - 100% -

- -

- 8 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1class Bun: 

-

2 """ 

-

3 Модель булочки для бургера. 

-

4 Булочке можно дать название и назначить цену. 

-

5 """ 

-

6 

-

7 def __init__(self, name: str, price: float): 

-

8 self.name = name 

-

9 self.price = price 

-

10 

-

11 def get_name(self) -> str: 

-

12 return self.name 

-

13 

-

14 def get_price(self) -> float: 

-

15 return self.price 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_burger_py.html b/htmlcov/z_c68eb0c7512457e4_burger_py.html deleted file mode 100644 index 554ae7136..000000000 --- a/htmlcov/z_c68eb0c7512457e4_burger_py.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - Coverage for praktikum\burger.py: 100% - - - - - -
-
-

- Coverage for praktikum\burger.py: - 100% -

- -

- 27 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1from typing import List 

-

2 

-

3from praktikum.bun import Bun 

-

4from praktikum.ingredient import Ingredient 

-

5 

-

6 

-

7class Burger: 

-

8 """ 

-

9 Модель бургера. 

-

10 Бургер состоит из булочек и ингредиентов (начинка или соус). 

-

11 Ингредиенты можно перемещать и удалять. 

-

12 Можно распечать чек с информацией о бургере. 

-

13 """ 

-

14 

-

15 def __init__(self): 

-

16 self.bun = None 

-

17 self.ingredients: List[Ingredient] = [] 

-

18 

-

19 def set_buns(self, bun: Bun): 

-

20 self.bun = bun 

-

21 

-

22 def add_ingredient(self, ingredient: Ingredient): 

-

23 self.ingredients.append(ingredient) 

-

24 

-

25 def remove_ingredient(self, index: int): 

-

26 del self.ingredients[index] 

-

27 

-

28 def move_ingredient(self, index: int, new_index: int): 

-

29 self.ingredients.insert(new_index, self.ingredients.pop(index)) 

-

30 

-

31 def get_price(self) -> float: 

-

32 price = self.bun.get_price() * 2 

-

33 

-

34 for ingredient in self.ingredients: 

-

35 price += ingredient.get_price() 

-

36 

-

37 return price 

-

38 

-

39 def get_receipt(self) -> str: 

-

40 receipt: List[str] = [f'(==== {self.bun.get_name()} ====)'] 

-

41 

-

42 for ingredient in self.ingredients: 

-

43 receipt.append(f'= {str(ingredient.get_type()).lower()} {ingredient.get_name()} =') 

-

44 

-

45 receipt.append(f'(==== {self.bun.get_name()} ====)\n') 

-

46 receipt.append(f'Price: {self.get_price()}') 

-

47 

-

48 return '\n'.join(receipt) 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_database_py.html b/htmlcov/z_c68eb0c7512457e4_database_py.html deleted file mode 100644 index 8e158dfb8..000000000 --- a/htmlcov/z_c68eb0c7512457e4_database_py.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - Coverage for praktikum\database.py: 100% - - - - - -
-
-

- Coverage for praktikum\database.py: - 100% -

- -

- 21 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1from typing import List 

-

2 

-

3from praktikum.bun import Bun 

-

4from praktikum.ingredient import Ingredient 

-

5from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING 

-

6 

-

7 

-

8class Database: 

-

9 """ 

-

10 Класс с методами по работе с базой данных. 

-

11 """ 

-

12 

-

13 def __init__(self): 

-

14 self.buns: List[Bun] = [] 

-

15 self.ingredients: List[Ingredient] = [] 

-

16 

-

17 self.buns.append(Bun("black bun", 100)) 

-

18 self.buns.append(Bun("white bun", 200)) 

-

19 self.buns.append(Bun("red bun", 300)) 

-

20 

-

21 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 100)) 

-

22 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "sour cream", 200)) 

-

23 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "chili sauce", 300)) 

-

24 

-

25 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "cutlet", 100)) 

-

26 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "dinosaur", 200)) 

-

27 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "sausage", 300)) 

-

28 

-

29 def available_buns(self) -> List[Bun]: 

-

30 return self.buns 

-

31 

-

32 def available_ingredients(self) -> List[Ingredient]: 

-

33 return self.ingredients 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_py.html deleted file mode 100644 index cd951afc6..000000000 --- a/htmlcov/z_c68eb0c7512457e4_ingredient_py.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Coverage for praktikum\ingredient.py: 100% - - - - - -
-
-

- Coverage for praktikum\ingredient.py: - 100% -

- -

- 11 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1class Ingredient: 

-

2 """ 

-

3 Модель ингредиента. 

-

4 Ингредиент: начинка или соус. 

-

5 У ингредиента есть тип (начинка или соус), название и цена. 

-

6 """ 

-

7 

-

8 def __init__(self, ingredient_type: str, name: str, price: float): 

-

9 self.type = ingredient_type 

-

10 self.name = name 

-

11 self.price = price 

-

12 

-

13 def get_price(self) -> float: 

-

14 return self.price 

-

15 

-

16 def get_name(self) -> str: 

-

17 return self.name 

-

18 

-

19 def get_type(self) -> str: 

-

20 return self.type 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html deleted file mode 100644 index ce28baf35..000000000 --- a/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Coverage for praktikum\ingredient_types.py: 100% - - - - - -
-
-

- Coverage for praktikum\ingredient_types.py: - 100% -

- -

- 2 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1""" 

-

2Перечисление с типами ингредиентов. 

-

3SAUCE – соус 

-

4FILLING – начинка 

-

5""" 

-

6INGREDIENT_TYPE_SAUCE = 'SAUCE' 

-

7INGREDIENT_TYPE_FILLING = 'FILLING' 

-
- - - diff --git a/htmlcov/z_c68eb0c7512457e4_praktikum_py.html b/htmlcov/z_c68eb0c7512457e4_praktikum_py.html deleted file mode 100644 index 7dac16d95..000000000 --- a/htmlcov/z_c68eb0c7512457e4_praktikum_py.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - Coverage for praktikum\praktikum.py: 95% - - - - - -
-
-

- Coverage for praktikum\praktikum.py: - 95% -

- -

- 20 statements   - - - -

-

- « prev     - ^ index     - » next -       - coverage.py v7.11.0, - created at 2025-12-24 21:19 +0100 -

- -
-
-
-

1 

-

2from typing import List 

-

3 

-

4from praktikum.bun import Bun 

-

5from praktikum.burger import Burger 

-

6from praktikum.database import Database 

-

7from praktikum.ingredient import Ingredient 

-

8 

-

9 

-

10def main(): 

-

11 # Инициализируем базу данных 

-

12 database: Database = Database() 

-

13 

-

14 # Создадим новый бургер 

-

15 burger: Burger = Burger() 

-

16 

-

17 # Считаем список доступных булок из базы данных 

-

18 buns: List[Bun] = database.available_buns() 

-

19 

-

20 # Считаем список доступных ингредиентов из базы данных 

-

21 ingredients: List[Ingredient] = database.available_ingredients() 

-

22 

-

23 # Соберём бургер 

-

24 burger.set_buns(buns[0]) 

-

25 

-

26 burger.add_ingredient(ingredients[1]) 

-

27 burger.add_ingredient(ingredients[4]) 

-

28 burger.add_ingredient(ingredients[3]) 

-

29 burger.add_ingredient(ingredients[5]) 

-

30 

-

31 # Переместим слой с ингредиентом 

-

32 burger.move_ingredient(2, 1) 

-

33 

-

34 # Удалим ингредиент 

-

35 burger.remove_ingredient(3) 

-

36 

-

37 # Распечатаем рецепт бургера 

-

38 print(burger.get_receipt()) 

-

39 

-

40 

-

41if __name__ == "__main__": 

-

42 main() 

-
- - - diff --git a/tests/test_praktikum.py b/tests/test_praktikum.py index 23d0ed0d9..26215349c 100644 --- a/tests/test_praktikum.py +++ b/tests/test_praktikum.py @@ -2,28 +2,11 @@ from unittest.mock import Mock, patch, call from praktikum.praktikum import main + class TestPraktikum: """Тестирование основного модуля программы (функции main)""" - - @pytest.fixture - def mock_db_and_burger(self): - """Фикстура для настройки общего мока базы данных""" - with patch('praktikum.praktikum.Database') as mock_db_class, \ - patch('praktikum.praktikum.Burger') as mock_burger_class: - - mock_db_instance = Mock() - mock_db_class.return_value = mock_db_instance - - mock_burger_instance = Mock() - mock_burger_class.return_value = mock_burger_instance - - # Настройка минимально необходимых данных в БД - mock_buns = [Mock() for _ in range(3)] - mock_ingredients = [Mock() for _ in range(6)] - mock_db_instance.available_buns.return_value = mock_buns - mock_db_instance.available_ingredients.return_value = mock_ingredients - - yield mock_db_instance, mock_burger_instance + + # Фикстура mock_db_and_burger теперь находится в conftest.py @patch('praktikum.praktikum.print') def test_main_calls_database_methods(self, mock_print, mock_db_and_burger): @@ -67,4 +50,4 @@ def test_main_prints_receipt(self, mock_print, mock_db_and_burger): main() mock_burger_instance.get_receipt.assert_called_once() - mock_print.assert_called_once_with(mock_receipt) + mock_print.assert_called_once_with(mock_receipt) \ No newline at end of file From 55c068f9880c47f237914fa2046cae2e82c25eeb Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Mon, 5 Jan 2026 21:19:12 +0100 Subject: [PATCH 53/54] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/conftest.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5780efc9f..b55c5abc2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,3 @@ - """ Общие фикстуры для тестов """ @@ -49,7 +48,6 @@ def burger_with_ingredients(mock_bun, mock_sauce_ingredient, mock_filling_ingred return burger - @pytest.fixture def mock_database(): """Фикстура для создания мока базы данных""" @@ -76,3 +74,26 @@ def mock_database(): database.available_ingredients.return_value = mock_ingredients return database + + +@pytest.fixture +def mock_db_and_burger(): + """Фикстура для настройки общего мока базы данных и бургера""" + from unittest.mock import Mock, patch + + with patch('praktikum.praktikum.Database') as mock_db_class, \ + patch('praktikum.praktikum.Burger') as mock_burger_class: + + mock_db_instance = Mock() + mock_db_class.return_value = mock_db_instance + + mock_burger_instance = Mock() + mock_burger_class.return_value = mock_burger_instance + + # Настройка минимально необходимых данных в БД + mock_buns = [Mock() for _ in range(3)] + mock_ingredients = [Mock() for _ in range(6)] + mock_db_instance.available_buns.return_value = mock_buns + mock_db_instance.available_ingredients.return_value = mock_ingredients + + yield mock_db_instance, mock_burger_instance \ No newline at end of file From 9f1a40577cfe09a07c63a9486474cab85f323b8d Mon Sep 17 00:00:00 2001 From: Olga Korzinina Date: Mon, 5 Jan 2026 21:28:12 +0100 Subject: [PATCH 54/54] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BE=D1=82=D1=87=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htmlcov/.gitignore | 2 + htmlcov/class_index.html | 195 +++++ htmlcov/coverage_html_cb_497bf287.js | 733 ++++++++++++++++++ htmlcov/favicon_32_cb_58284776.png | Bin 0 -> 1732 bytes htmlcov/function_index.html | 307 ++++++++ htmlcov/index.html | 153 ++++ htmlcov/keybd_closed_cb_ce680311.png | Bin 0 -> 9004 bytes htmlcov/status.json | 1 + htmlcov/style_cb_dca529e9.css | 377 +++++++++ htmlcov/z_c68eb0c7512457e4___init___py.html | 98 +++ htmlcov/z_c68eb0c7512457e4_bun_py.html | 112 +++ htmlcov/z_c68eb0c7512457e4_burger_py.html | 145 ++++ htmlcov/z_c68eb0c7512457e4_database_py.html | 130 ++++ htmlcov/z_c68eb0c7512457e4_ingredient_py.html | 117 +++ ..._c68eb0c7512457e4_ingredient_types_py.html | 104 +++ htmlcov/z_c68eb0c7512457e4_praktikum_py.html | 139 ++++ 16 files changed, 2613 insertions(+) create mode 100644 htmlcov/.gitignore create mode 100644 htmlcov/class_index.html create mode 100644 htmlcov/coverage_html_cb_497bf287.js create mode 100644 htmlcov/favicon_32_cb_58284776.png create mode 100644 htmlcov/function_index.html create mode 100644 htmlcov/index.html create mode 100644 htmlcov/keybd_closed_cb_ce680311.png create mode 100644 htmlcov/status.json create mode 100644 htmlcov/style_cb_dca529e9.css create mode 100644 htmlcov/z_c68eb0c7512457e4___init___py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_bun_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_burger_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_database_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html create mode 100644 htmlcov/z_c68eb0c7512457e4_praktikum_py.html diff --git a/htmlcov/.gitignore b/htmlcov/.gitignore new file mode 100644 index 000000000..ccccf1423 --- /dev/null +++ b/htmlcov/.gitignore @@ -0,0 +1,2 @@ +# Created by coverage.py +* diff --git a/htmlcov/class_index.html b/htmlcov/class_index.html new file mode 100644 index 000000000..3560c2811 --- /dev/null +++ b/htmlcov/class_index.html @@ -0,0 +1,195 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fileclassstatementsmissingexcludedcoverage
praktikum\__init__.py(no class)000100%
praktikum\bun.pyBun400100%
praktikum\bun.py(no class)400100%
praktikum\burger.pyBurger1600100%
praktikum\burger.py(no class)1100100%
praktikum\database.pyDatabase1300100%
praktikum\database.py(no class)800100%
praktikum\ingredient.pyIngredient600100%
praktikum\ingredient.py(no class)500100%
praktikum\ingredient_types.py(no class)200100%
praktikum\praktikum.py(no class)201095%
Total 891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/coverage_html_cb_497bf287.js b/htmlcov/coverage_html_cb_497bf287.js new file mode 100644 index 000000000..1face13de --- /dev/null +++ b/htmlcov/coverage_html_cb_497bf287.js @@ -0,0 +1,733 @@ +// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +// Coverage.py HTML report browser code. +/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ +/*global coverage: true, document, window, $ */ + +coverage = {}; + +// General helpers +function debounce(callback, wait) { + let timeoutId = null; + return function(...args) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + callback.apply(this, args); + }, wait); + }; +}; + +function checkVisible(element) { + const rect = element.getBoundingClientRect(); + const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); + const viewTop = 30; + return !(rect.bottom < viewTop || rect.top >= viewBottom); +} + +function on_click(sel, fn) { + const elt = document.querySelector(sel); + if (elt) { + elt.addEventListener("click", fn); + } +} + +// Helpers for table sorting +function getCellValue(row, column = 0) { + const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.childElementCount == 1) { + var child = cell.firstElementChild; + if (child.tagName === "A") { + child = child.firstElementChild; + } + if (child instanceof HTMLDataElement && child.value) { + return child.value; + } + } + return cell.innerText || cell.textContent; +} + +function rowComparator(rowA, rowB, column = 0) { + let valueA = getCellValue(rowA, column); + let valueB = getCellValue(rowB, column); + if (!isNaN(valueA) && !isNaN(valueB)) { + return valueA - valueB; + } + return valueA.localeCompare(valueB, undefined, {numeric: true}); +} + +function sortColumn(th) { + // Get the current sorting direction of the selected header, + // clear state on other headers and then set the new sorting direction. + const currentSortOrder = th.getAttribute("aria-sort"); + [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); + var direction; + if (currentSortOrder === "none") { + direction = th.dataset.defaultSortOrder || "ascending"; + } + else if (currentSortOrder === "ascending") { + direction = "descending"; + } + else { + direction = "ascending"; + } + th.setAttribute("aria-sort", direction); + + const column = [...th.parentElement.cells].indexOf(th) + + // Sort all rows and afterwards append them in order to move them in the DOM. + Array.from(th.closest("table").querySelectorAll("tbody tr")) + .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (direction === "ascending" ? 1 : -1)) + .forEach(tr => tr.parentElement.appendChild(tr)); + + // Save the sort order for next time. + if (th.id !== "region") { + let th_id = "file"; // Sort by file if we don't have a column id + let current_direction = direction; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)) + } + localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ + "th_id": th.id, + "direction": current_direction + })); + if (th.id !== th_id || document.getElementById("region")) { + // Sort column has changed, unset sorting by function or class. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": false, + "region_direction": current_direction + })); + } + } + else { + // Sort column has changed to by function or class, remember that. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": true, + "region_direction": direction + })); + } +} + +// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. +coverage.assign_shortkeys = function () { + document.querySelectorAll("[data-shortcut]").forEach(element => { + document.addEventListener("keypress", event => { + if (event.target.tagName.toLowerCase() === "input") { + return; // ignore keypress from search filter + } + if (event.key === element.dataset.shortcut) { + element.click(); + } + }); + }); +}; + +// Create the events for the filter box. +coverage.wire_up_filter = function () { + // Populate the filter and hide100 inputs if there are saved values for them. + const saved_filter_value = localStorage.getItem(coverage.FILTER_STORAGE); + if (saved_filter_value) { + document.getElementById("filter").value = saved_filter_value; + } + const saved_hide100_value = localStorage.getItem(coverage.HIDE100_STORAGE); + if (saved_hide100_value) { + document.getElementById("hide100").checked = JSON.parse(saved_hide100_value); + } + + // Cache elements. + const table = document.querySelector("table.index"); + const table_body_rows = table.querySelectorAll("tbody tr"); + const no_rows = document.getElementById("no_rows"); + + // Observe filter keyevents. + const filter_handler = (event => { + // Keep running total of each metric, first index contains number of shown rows + const totals = new Array(table.rows[0].cells.length).fill(0); + // Accumulate the percentage as fraction + totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection + + var text = document.getElementById("filter").value; + // Store filter value + localStorage.setItem(coverage.FILTER_STORAGE, text); + const casefold = (text === text.toLowerCase()); + const hide100 = document.getElementById("hide100").checked; + // Store hide value. + localStorage.setItem(coverage.HIDE100_STORAGE, JSON.stringify(hide100)); + + // Hide / show elements. + table_body_rows.forEach(row => { + var show = false; + // Check the text filter. + for (let column = 0; column < totals.length; column++) { + cell = row.cells[column]; + if (cell.classList.contains("name")) { + var celltext = cell.textContent; + if (casefold) { + celltext = celltext.toLowerCase(); + } + if (celltext.includes(text)) { + show = true; + } + } + } + + // Check the "hide covered" filter. + if (show && hide100) { + const [numer, denom] = row.cells[row.cells.length - 1].dataset.ratio.split(" "); + show = (numer !== denom); + } + + if (!show) { + // hide + row.classList.add("hidden"); + return; + } + + // show + row.classList.remove("hidden"); + totals[0]++; + + for (let column = 0; column < totals.length; column++) { + // Accumulate dynamic totals + cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + if (column === totals.length - 1) { + // Last column contains percentage + const [numer, denom] = cell.dataset.ratio.split(" "); + totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection + totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection + } + else { + totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection + } + } + }); + + // Show placeholder if no rows will be displayed. + if (!totals[0]) { + // Show placeholder, hide table. + no_rows.style.display = "block"; + table.style.display = "none"; + return; + } + + // Hide placeholder, show table. + no_rows.style.display = null; + table.style.display = null; + + const footer = table.tFoot.rows[0]; + // Calculate new dynamic sum values based on visible rows. + for (let column = 0; column < totals.length; column++) { + // Get footer cell element. + const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + + // Set value into dynamic footer cell element. + if (column === totals.length - 1) { + // Percentage column uses the numerator and denominator, + // and adapts to the number of decimal places. + const match = /\.([0-9]+)/.exec(cell.textContent); + const places = match ? match[1].length : 0; + const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection + cell.dataset.ratio = `${numer} ${denom}`; + // Check denom to prevent NaN if filtered files contain no statements + cell.textContent = denom + ? `${(numer * 100 / denom).toFixed(places)}%` + : `${(100).toFixed(places)}%`; + } + else { + cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection + } + } + }); + + document.getElementById("filter").addEventListener("input", debounce(filter_handler)); + document.getElementById("hide100").addEventListener("input", debounce(filter_handler)); + + // Trigger change event on setup, to force filter on page refresh + // (filter value may still be present). + document.getElementById("filter").dispatchEvent(new Event("input")); + document.getElementById("hide100").dispatchEvent(new Event("input")); +}; +coverage.FILTER_STORAGE = "COVERAGE_FILTER_VALUE"; +coverage.HIDE100_STORAGE = "COVERAGE_HIDE100_VALUE"; + +// Set up the click-to-sort columns. +coverage.wire_up_sorting = function () { + document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( + th => th.addEventListener("click", e => sortColumn(e.target)) + ); + + // Look for a localStorage item containing previous sort settings: + let th_id = "file", direction = "ascending"; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)); + } + let by_region = false, region_direction = "ascending"; + const sorted_by_region = localStorage.getItem(coverage.SORTED_BY_REGION); + if (sorted_by_region) { + ({ + by_region, + region_direction + } = JSON.parse(sorted_by_region)); + } + + const region_id = "region"; + if (by_region && document.getElementById(region_id)) { + direction = region_direction; + } + // If we are in a page that has a column with id of "region", sort on + // it if the last sort was by function or class. + let th; + if (document.getElementById(region_id)) { + th = document.getElementById(by_region ? region_id : th_id); + } + else { + th = document.getElementById(th_id); + } + th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); + th.click() +}; + +coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; +coverage.SORTED_BY_REGION = "COVERAGE_SORT_REGION"; + +// Loaded on index.html +coverage.index_ready = function () { + coverage.assign_shortkeys(); + coverage.wire_up_filter(); + coverage.wire_up_sorting(); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + + on_click(".button_show_hide_help", coverage.show_hide_help); +}; + +// -- pyfile stuff -- + +coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; + +coverage.pyfile_ready = function () { + // If we're directed to a particular line number, highlight the line. + var frag = location.hash; + if (frag.length > 2 && frag[1] === "t") { + document.querySelector(frag).closest(".n").classList.add("highlight"); + coverage.set_sel(parseInt(frag.substr(2), 10)); + } + else { + coverage.set_sel(0); + } + + on_click(".button_toggle_run", coverage.toggle_lines); + on_click(".button_toggle_mis", coverage.toggle_lines); + on_click(".button_toggle_exc", coverage.toggle_lines); + on_click(".button_toggle_par", coverage.toggle_lines); + + on_click(".button_next_chunk", coverage.to_next_chunk_nicely); + on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); + on_click(".button_top_of_page", coverage.to_top); + on_click(".button_first_chunk", coverage.to_first_chunk); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + on_click(".button_to_index", coverage.to_index); + + on_click(".button_show_hide_help", coverage.show_hide_help); + + coverage.filters = undefined; + try { + coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); + } catch(err) {} + + if (coverage.filters) { + coverage.filters = JSON.parse(coverage.filters); + } + else { + coverage.filters = {run: false, exc: true, mis: true, par: true}; + } + + for (cls in coverage.filters) { + coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection + } + + coverage.assign_shortkeys(); + coverage.init_scroll_markers(); + coverage.wire_up_sticky_header(); + + document.querySelectorAll("[id^=ctxs]").forEach( + cbox => cbox.addEventListener("click", coverage.expand_contexts) + ); + + // Rebuild scroll markers when the window height changes. + window.addEventListener("resize", coverage.build_scroll_markers); +}; + +coverage.toggle_lines = function (event) { + const btn = event.target.closest("button"); + const category = btn.value + const show = !btn.classList.contains("show_" + category); + coverage.set_line_visibilty(category, show); + coverage.build_scroll_markers(); + coverage.filters[category] = show; + try { + localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); + } catch(err) {} +}; + +coverage.set_line_visibilty = function (category, should_show) { + const cls = "show_" + category; + const btn = document.querySelector(".button_toggle_" + category); + if (btn) { + if (should_show) { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); + btn.classList.add(cls); + } + else { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); + btn.classList.remove(cls); + } + } +}; + +// Return the nth line div. +coverage.line_elt = function (n) { + return document.getElementById("t" + n)?.closest("p"); +}; + +// Set the selection. b and e are line numbers. +coverage.set_sel = function (b, e) { + // The first line selected. + coverage.sel_begin = b; + // The next line not selected. + coverage.sel_end = (e === undefined) ? b+1 : e; +}; + +coverage.to_top = function () { + coverage.set_sel(0, 1); + coverage.scroll_window(0); +}; + +coverage.to_first_chunk = function () { + coverage.set_sel(0, 1); + coverage.to_next_chunk(); +}; + +coverage.to_prev_file = function () { + window.location = document.getElementById("prevFileLink").href; +} + +coverage.to_next_file = function () { + window.location = document.getElementById("nextFileLink").href; +} + +coverage.to_index = function () { + location.href = document.getElementById("indexLink").href; +} + +coverage.show_hide_help = function () { + const helpCheck = document.getElementById("help_panel_state") + helpCheck.checked = !helpCheck.checked; +} + +// Return a string indicating what kind of chunk this line belongs to, +// or null if not a chunk. +coverage.chunk_indicator = function (line_elt) { + const classes = line_elt?.className; + if (!classes) { + return null; + } + const match = classes.match(/\bshow_\w+\b/); + if (!match) { + return null; + } + return match[0]; +}; + +coverage.to_next_chunk = function () { + const c = coverage; + + // Find the start of the next colored chunk. + var probe = c.sel_end; + var chunk_indicator, probe_line; + while (true) { + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + if (chunk_indicator) { + break; + } + probe++; + } + + // There's a next chunk, `probe` points to it. + var begin = probe; + + // Find the end of this chunk. + var next_indicator = chunk_indicator; + while (next_indicator === chunk_indicator) { + probe++; + probe_line = c.line_elt(probe); + next_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(begin, probe); + c.show_selection(); +}; + +coverage.to_prev_chunk = function () { + const c = coverage; + + // Find the end of the prev colored chunk. + var probe = c.sel_begin-1; + var probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + var chunk_indicator = c.chunk_indicator(probe_line); + while (probe > 1 && !chunk_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + } + + // There's a prev chunk, `probe` points to its last line. + var end = probe+1; + + // Find the beginning of this chunk. + var prev_indicator = chunk_indicator; + while (prev_indicator === chunk_indicator) { + probe--; + if (probe <= 0) { + return; + } + probe_line = c.line_elt(probe); + prev_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(probe+1, end); + c.show_selection(); +}; + +// Returns 0, 1, or 2: how many of the two ends of the selection are on +// the screen right now? +coverage.selection_ends_on_screen = function () { + if (coverage.sel_begin === 0) { + return 0; + } + + const begin = coverage.line_elt(coverage.sel_begin); + const end = coverage.line_elt(coverage.sel_end-1); + + return ( + (checkVisible(begin) ? 1 : 0) + + (checkVisible(end) ? 1 : 0) + ); +}; + +coverage.to_next_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the top line on the screen as selection. + + // This will select the top-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(0, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(1); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_next_chunk(); +}; + +coverage.to_prev_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the lowest line on the screen as selection. + + // This will select the bottom-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(coverage.lines_len); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_prev_chunk(); +}; + +// Select line number lineno, or if it is in a colored chunk, select the +// entire chunk +coverage.select_line_or_chunk = function (lineno) { + var c = coverage; + var probe_line = c.line_elt(lineno); + if (!probe_line) { + return; + } + var the_indicator = c.chunk_indicator(probe_line); + if (the_indicator) { + // The line is in a highlighted chunk. + // Search backward for the first line. + var probe = lineno; + var indicator = the_indicator; + while (probe > 0 && indicator === the_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + break; + } + indicator = c.chunk_indicator(probe_line); + } + var begin = probe + 1; + + // Search forward for the last line. + probe = lineno; + indicator = the_indicator; + while (indicator === the_indicator) { + probe++; + probe_line = c.line_elt(probe); + indicator = c.chunk_indicator(probe_line); + } + + coverage.set_sel(begin, probe); + } + else { + coverage.set_sel(lineno); + } +}; + +coverage.show_selection = function () { + // Highlight the lines in the chunk + document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); + for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { + coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); + } + + coverage.scroll_to_selection(); +}; + +coverage.scroll_to_selection = function () { + // Scroll the page if the chunk isn't fully visible. + if (coverage.selection_ends_on_screen() < 2) { + const element = coverage.line_elt(coverage.sel_begin); + coverage.scroll_window(element.offsetTop - 60); + } +}; + +coverage.scroll_window = function (to_pos) { + window.scroll({top: to_pos, behavior: "smooth"}); +}; + +coverage.init_scroll_markers = function () { + // Init some variables + coverage.lines_len = document.querySelectorAll("#source > p").length; + + // Build html + coverage.build_scroll_markers(); +}; + +coverage.build_scroll_markers = function () { + const temp_scroll_marker = document.getElementById("scroll_marker") + if (temp_scroll_marker) temp_scroll_marker.remove(); + // Don't build markers if the window has no scroll bar. + if (document.body.scrollHeight <= window.innerHeight) { + return; + } + + const marker_scale = window.innerHeight / document.body.scrollHeight; + const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); + + let previous_line = -99, last_mark, last_top; + + const scroll_marker = document.createElement("div"); + scroll_marker.id = "scroll_marker"; + document.getElementById("source").querySelectorAll( + "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" + ).forEach(element => { + const line_top = Math.floor(element.offsetTop * marker_scale); + const line_number = parseInt(element.querySelector(".n a").id.substr(1)); + + if (line_number === previous_line + 1) { + // If this solid missed block just make previous mark higher. + last_mark.style.height = `${line_top + line_height - last_top}px`; + } + else { + // Add colored line in scroll_marker block. + last_mark = document.createElement("div"); + last_mark.id = `m${line_number}`; + last_mark.classList.add("marker"); + last_mark.style.height = `${line_height}px`; + last_mark.style.top = `${line_top}px`; + scroll_marker.append(last_mark); + last_top = line_top; + } + + previous_line = line_number; + }); + + // Append last to prevent layout calculation + document.body.append(scroll_marker); +}; + +coverage.wire_up_sticky_header = function () { + const header = document.querySelector("header"); + const header_bottom = ( + header.querySelector(".content h2").getBoundingClientRect().top - + header.getBoundingClientRect().top + ); + + function updateHeader() { + if (window.scrollY > header_bottom) { + header.classList.add("sticky"); + } + else { + header.classList.remove("sticky"); + } + } + + window.addEventListener("scroll", updateHeader); + updateHeader(); +}; + +coverage.expand_contexts = function (e) { + var ctxs = e.target.parentNode.querySelector(".ctxs"); + + if (!ctxs.classList.contains("expanded")) { + var ctxs_text = ctxs.textContent; + var width = Number(ctxs_text[0]); + ctxs.textContent = ""; + for (var i = 1; i < ctxs_text.length; i += width) { + key = ctxs_text.substring(i, i + width).trim(); + ctxs.appendChild(document.createTextNode(contexts[key])); + ctxs.appendChild(document.createElement("br")); + } + ctxs.classList.add("expanded"); + } +}; + +document.addEventListener("DOMContentLoaded", () => { + if (document.body.classList.contains("indexfile")) { + coverage.index_ready(); + } + else { + coverage.pyfile_ready(); + } +}); diff --git a/htmlcov/favicon_32_cb_58284776.png b/htmlcov/favicon_32_cb_58284776.png new file mode 100644 index 0000000000000000000000000000000000000000..8649f0475d8d20793b2ec431fe25a186a414cf10 GIT binary patch literal 1732 zcmV;#20QtQP)K2KOkBOVxIZChq#W-v7@TU%U6P(wycKT1hUJUToW3ke1U1ONa4 z000000000000000bb)GRa9mqwR9|UWHy;^RUrt?IT__Y0JUcxmBP0(51q1>E00030 z|NrOz)aw7%8sJzM<5^g%z7^qE`}_Ot|JUUG(NUkWzR|7K?Zo%@_v-8G-1N%N=D$;; zw;keH4dGY$`1t4M=HK_s*zm^0#KgqfwWhe3qO_HtvXYvtjgX>;-~C$L`&k>^R)9)7 zdPh2TL^pCnHC#0+_4D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YB)^7)XA zZwo9zDy-B0B+jT6V=!=bo(zs_8{eBA78gT9GH$(DVhz;4VAYwz+bOIdZ-PNb|I&rl z^XG=vFLF)1{&nT2*0vMz#}7^9hXzzf&ZdKlEj{LihP;|;Ywqn35ajP?H?7t|i-Un% z&&kxee@9B{nwgv1+S-~0)E1{ob1^Wn`F2isurqThKK=3%&;`@{0{!D- z&CSj80t;uPu&FaJFtSXKH#ajgGj}=sEad7US6jP0|Db@0j)?(5@sf<7`~a9>s;wCa zm^)spe{uxGFmrJYI9cOh7s$>8Npkt-5EWB1UKc`{W{y5Ce$1+nM9Cr;);=Ju#N^62OSlJMn7omiUgP&ErsYzT~iGxcW aE(`!K@+CXylaC4j0000 + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filefunctionstatementsmissingexcludedcoverage
praktikum\__init__.py(no function)000100%
praktikum\bun.pyBun.__init__200100%
praktikum\bun.pyBun.get_name100100%
praktikum\bun.pyBun.get_price100100%
praktikum\bun.py(no function)400100%
praktikum\burger.pyBurger.__init__200100%
praktikum\burger.pyBurger.set_buns100100%
praktikum\burger.pyBurger.add_ingredient100100%
praktikum\burger.pyBurger.remove_ingredient100100%
praktikum\burger.pyBurger.move_ingredient100100%
praktikum\burger.pyBurger.get_price400100%
praktikum\burger.pyBurger.get_receipt600100%
praktikum\burger.py(no function)1100100%
praktikum\database.pyDatabase.__init__1100100%
praktikum\database.pyDatabase.available_buns100100%
praktikum\database.pyDatabase.available_ingredients100100%
praktikum\database.py(no function)800100%
praktikum\ingredient.pyIngredient.__init__300100%
praktikum\ingredient.pyIngredient.get_price100100%
praktikum\ingredient.pyIngredient.get_name100100%
praktikum\ingredient.pyIngredient.get_type100100%
praktikum\ingredient.py(no function)500100%
praktikum\ingredient_types.py(no function)200100%
praktikum\praktikum.pymain1200100%
praktikum\praktikum.py(no function)81088%
Total 891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/index.html b/htmlcov/index.html new file mode 100644 index 000000000..266f9208a --- /dev/null +++ b/htmlcov/index.html @@ -0,0 +1,153 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 99% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filestatementsmissingexcludedcoverage
praktikum\__init__.py000100%
praktikum\bun.py800100%
praktikum\burger.py2700100%
praktikum\database.py2100100%
praktikum\ingredient.py1100100%
praktikum\ingredient_types.py200100%
praktikum\praktikum.py201095%
Total891099%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/htmlcov/keybd_closed_cb_ce680311.png b/htmlcov/keybd_closed_cb_ce680311.png new file mode 100644 index 0000000000000000000000000000000000000000..ba119c47df81ed2bbd27a06988abf700139c4f99 GIT binary patch literal 9004 zcmeHLc{tSF+aIY=A^R4_poB4tZAN2XC;O7M(inrW3}(h&Q4}dl*&-65$i9^&vW6_# zcM4g`Qix=GhkBl;=lwnJ@Ap2}^}hc-b6vBXb3XUyzR%~}_c`-Dw+!?&>5p(90RRB> zXe~7($~PP3eT?=X<@3~Q1w84vX~IoSx~1#~02+TopXK(db;4v6!{+W`RHLkkHO zo;+s?)puc`+$yOwHv>I$5^8v^F3<|$44HA8AFnFB0cAP|C`p}aSMJK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P630I;$1cpQ+Ay7C34hK^ZV3H4kjPV8&NP>G5 zKRDEIBrFl{M#j4mfP0)68&?mqJP1S?2mU0djAGTjDV;wZ?6vplNn~3Hn$nP>%!dMi zz@bnC7zzi&k&s{QDWkf&zgrVXKUJjY3Gv3bL0}S4h>OdgEJ$Q^&p-VAr3J}^a*+rz z!jW7(h*+GuCyqcC{MD(Ovj^!{pB^OKUe|uy&bD?CN>KZrf3?v>>l*xSvnQiH-o^ViN$%FRdm9url;%(*jf5H$*S)8;i0xWHdl>$p);nH9v0)YfW?Vz$! zNCeUbi9`NEg(i^57y=fzM@1o*z*Bf6?QCV>2p9}(BLlYsOCfMjFv1pw1mlo)Py{8v zppw{MDfEeWN+n>Ne~oI7%9cU}mz0r3!es2gNF0t5jkGipjIo2lz;-e)7}Ul_#!eDv zw;#>kI>;#-pyfeu3Fsd^2F@6=oh#8r9;A!G0`-mm7%{=S;Ec(bJ=I_`FodKGQVNEY zmXwr4{9*jpDl%4{ggQZ5Ac z%wYTdl*!1c5^)%^E78Q&)ma|27c6j(a=)g4sGrp$r{jv>>M2 z6y)E5|Aooe!PSfKzvKA>`a6pfK3=E8vL14ksP&f=>gOP?}rG6ye@9ZR3 zJF*vsh*P$w390i!FV~~_Hv6t2Zl<4VUi|rNja#boFt{%q~xGb z(2petq9A*_>~B*>?d?Olx^lmYg4)}sH2>G42RE; literal 0 HcmV?d00001 diff --git a/htmlcov/status.json b/htmlcov/status.json new file mode 100644 index 000000000..e09334d56 --- /dev/null +++ b/htmlcov/status.json @@ -0,0 +1 @@ +{"note":"This file is an internal implementation detail to speed up HTML report generation. Its format can change at any time. You might be looking for the JSON report: https://coverage.rtfd.io/cmd.html#cmd-json","format":5,"version":"7.11.0","globals":"37549cb6f10abc1cc097c51bdc6b860d","files":{"z_c68eb0c7512457e4___init___py":{"hash":"bd020ce57c982120e8c32a91267d330d","index":{"url":"z_c68eb0c7512457e4___init___py.html","file":"praktikum\\__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_bun_py":{"hash":"820fa7fb820fb46cf300dac8d31b6bd0","index":{"url":"z_c68eb0c7512457e4_bun_py.html","file":"praktikum\\bun.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":8,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_burger_py":{"hash":"facdb0a5be4ca4a1f2f321d5a2d8fb87","index":{"url":"z_c68eb0c7512457e4_burger_py.html","file":"praktikum\\burger.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":27,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_database_py":{"hash":"30732bb755a2f38ad46148435b66601a","index":{"url":"z_c68eb0c7512457e4_database_py.html","file":"praktikum\\database.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":21,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_py":{"hash":"d1fcf36fcdce67a9051fb6dc31d4fcd0","index":{"url":"z_c68eb0c7512457e4_ingredient_py.html","file":"praktikum\\ingredient.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":11,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_ingredient_types_py":{"hash":"2bcd1d2d9846c4979e7b61455ec13758","index":{"url":"z_c68eb0c7512457e4_ingredient_types_py.html","file":"praktikum\\ingredient_types.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":2,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_c68eb0c7512457e4_praktikum_py":{"hash":"7678957e5e3cc7b8263bb309fbd85bc3","index":{"url":"z_c68eb0c7512457e4_praktikum_py.html","file":"praktikum\\praktikum.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":20,"n_excluded":0,"n_missing":1,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}}}} \ No newline at end of file diff --git a/htmlcov/style_cb_dca529e9.css b/htmlcov/style_cb_dca529e9.css new file mode 100644 index 000000000..4735f2702 --- /dev/null +++ b/htmlcov/style_cb_dca529e9.css @@ -0,0 +1,377 @@ +@charset "UTF-8"; +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ +/* Don't edit this .css file. Edit the .scss file instead! */ +html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } + +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { body { color: #eee; } } + +html > body { font-size: 16px; } + +a:active, a:focus { outline: 2px dashed #007acc; } + +p { font-size: .875em; line-height: 1.4em; } + +table { border-collapse: collapse; } + +td { vertical-align: top; } + +table tr.hidden { display: none !important; } + +p#no_rows { display: none; font-size: 1.15em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +a.nav { text-decoration: none; color: inherit; } + +a.nav:hover { text-decoration: underline; color: inherit; } + +.hidden { display: none; } + +header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } + +@media (prefers-color-scheme: dark) { header { background: black; } } + +@media (prefers-color-scheme: dark) { header { border-color: #333; } } + +header .content { padding: 1rem 3.5rem; } + +header h2 { margin-top: .5em; font-size: 1em; } + +header h2 a.button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header h2 a.button { background: #333; } } + +@media (prefers-color-scheme: dark) { header h2 a.button { border-color: #444; } } + +header h2 a.button.current { border: 2px solid; background: #fff; border-color: #999; cursor: default; } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { border-color: #777; } } + +header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } + +header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } + +header.sticky .text { display: none; } + +header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } + +header.sticky .content { padding: 0.5rem 3.5rem; } + +header.sticky .content p { font-size: 1em; } + +header.sticky ~ #source { padding-top: 6.5em; } + +main { position: relative; z-index: 1; } + +footer { margin: 1rem 3.5rem; } + +footer .content { padding: 0; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } + +#index { margin: 1rem 0 0 3.5rem; } + +h1 { font-size: 1.25em; display: inline-block; } + +#filter_container { float: right; margin: 0 2em 0 0; line-height: 1.66em; } + +#filter_container #filter { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { #filter_container #filter { border-color: #444; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { color: #eee; } } + +#filter_container #filter:focus { border-color: #007acc; } + +#filter_container :disabled ~ label { color: #ccc; } + +@media (prefers-color-scheme: dark) { #filter_container :disabled ~ label { color: #444; } } + +#filter_container label { font-size: .875em; color: #666; } + +@media (prefers-color-scheme: dark) { #filter_container label { color: #aaa; } } + +header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header button { background: #333; } } + +@media (prefers-color-scheme: dark) { header button { border-color: #444; } } + +header button:active, header button:focus { outline: 2px dashed #007acc; } + +header button.run { background: #eeffee; } + +@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } + +header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } + +header button.mis { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } + +header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } + +header button.exc { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } + +header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } + +header button.par { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { header button.par { background: #650; } } + +header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } + +#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } + +#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } + +#help_panel_wrapper { float: right; position: relative; } + +#keyboard_icon { margin: 5px; } + +#help_panel_state { display: none; } + +#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } + +#help_panel .keyhelp p { margin-top: .75em; } + +#help_panel .legend { font-style: italic; margin-bottom: 1em; } + +.indexfile #help_panel { width: 25em; } + +.pyfile #help_panel { width: 18em; } + +#help_panel_state:checked ~ #help_panel { display: block; } + +kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } + +#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } + +#source p { position: relative; white-space: pre; } + +#source p * { box-sizing: border-box; } + +#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; user-select: none; } + +@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } + +#source p .n.highlight { background: #ffdd00; } + +#source p .n a { scroll-margin-top: 6em; text-decoration: none; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } + +#source p .n a:hover { text-decoration: underline; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } + +#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } + +@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } + +#source p .t:hover { background: #f2f2f2; } + +@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } + +#source p .t:hover ~ .r .annotate.long { display: block; } + +#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } + +@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } + +#source p .t .key { font-weight: bold; line-height: 1px; } + +#source p .t .str, #source p .t .fst { color: #0451a5; } + +@media (prefers-color-scheme: dark) { #source p .t .str, #source p .t .fst { color: #9cdcfe; } } + +#source p.mis .t { border-left: 0.2em solid #ff0000; } + +#source p.mis.show_mis .t { background: #fdd; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } + +#source p.mis.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } + +#source p.mis.mis2 .t { border-left: 0.2em dotted #ff0000; } + +#source p.mis.mis2.show_mis .t { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t { background: #351b1b; } } + +#source p.mis.mis2.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.mis2.show_mis .t:hover { background: #532323; } } + +#source p.run .t { border-left: 0.2em solid #00dd00; } + +#source p.run.show_run .t { background: #dfd; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } + +#source p.run.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } + +#source p.run.run2 .t { border-left: 0.2em dotted #00dd00; } + +#source p.run.run2.show_run .t { background: #eeffee; } + +@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t { background: #2b2e24; } } + +#source p.run.run2.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.run2.show_run .t:hover { background: #404633; } } + +#source p.exc .t { border-left: 0.2em solid #808080; } + +#source p.exc.show_exc .t { background: #eee; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } + +#source p.exc.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } + +#source p.exc.exc2 .t { border-left: 0.2em dotted #808080; } + +#source p.exc.exc2.show_exc .t { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t { background: #292929; } } + +#source p.exc.exc2.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.exc2.show_exc .t:hover { background: #3c3c3c; } } + +#source p.par .t { border-left: 0.2em solid #bbbb00; } + +#source p.par.show_par .t { background: #ffa; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } + +#source p.par.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } + +#source p.par.par2 .t { border-left: 0.2em dotted #bbbb00; } + +#source p.par.par2.show_par .t { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t { background: #423a0f; } } + +#source p.par.par2.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.par2.show_par .t:hover { background: #6d5d0c; } } + +#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } + +@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } + +#source p .annotate.short:hover ~ .long { display: block; } + +#source p .annotate.long { width: 30em; right: 2.5em; } + +#source p input { display: none; } + +#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } + +#source p input ~ .r label.ctx::before { content: "▶ "; } + +#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } + +#source p input:checked ~ .r label.ctx::before { content: "▼ "; } + +#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } + +#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } + +@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } + +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } + +#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } + +#index table.index { margin-left: -.5em; } + +#index td, #index th { text-align: right; padding: .25em .5em; border-bottom: 1px solid #eee; } + +@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } + +#index td.name, #index th.name { text-align: left; width: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; min-width: 15em; } + +#index th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-style: italic; color: #333; cursor: pointer; } + +@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } + +#index th:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } + +#index th .arrows { color: #666; font-size: 85%; font-family: sans-serif; font-style: normal; pointer-events: none; } + +#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } + +@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } + +#index th[aria-sort="ascending"] .arrows::after { content: " ▲"; } + +#index th[aria-sort="descending"] .arrows::after { content: " ▼"; } + +#index td.name { font-size: 1.15em; } + +#index td.name a { text-decoration: none; color: inherit; } + +#index td.name .no-noun { font-style: italic; } + +#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } + +#index tr.region:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index tr.region:hover { background: #333; } } + +#index tr.region:hover td.name { text-decoration: underline; color: inherit; } + +#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } + +@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } + +#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } + +@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/htmlcov/z_c68eb0c7512457e4___init___py.html b/htmlcov/z_c68eb0c7512457e4___init___py.html new file mode 100644 index 000000000..2572d9ffd --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4___init___py.html @@ -0,0 +1,98 @@ + + + + + Coverage for praktikum\__init__.py: 100% + + + + + +
+
+

+ Coverage for praktikum\__init__.py: + 100% +

+ +

+ 0 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_bun_py.html b/htmlcov/z_c68eb0c7512457e4_bun_py.html new file mode 100644 index 000000000..ecf83cb9c --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_bun_py.html @@ -0,0 +1,112 @@ + + + + + Coverage for praktikum\bun.py: 100% + + + + + +
+
+

+ Coverage for praktikum\bun.py: + 100% +

+ +

+ 8 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1class Bun: 

+

2 """ 

+

3 Модель булочки для бургера. 

+

4 Булочке можно дать название и назначить цену. 

+

5 """ 

+

6 

+

7 def __init__(self, name: str, price: float): 

+

8 self.name = name 

+

9 self.price = price 

+

10 

+

11 def get_name(self) -> str: 

+

12 return self.name 

+

13 

+

14 def get_price(self) -> float: 

+

15 return self.price 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_burger_py.html b/htmlcov/z_c68eb0c7512457e4_burger_py.html new file mode 100644 index 000000000..84fe3a81c --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_burger_py.html @@ -0,0 +1,145 @@ + + + + + Coverage for praktikum\burger.py: 100% + + + + + +
+
+

+ Coverage for praktikum\burger.py: + 100% +

+ +

+ 27 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1from typing import List 

+

2 

+

3from praktikum.bun import Bun 

+

4from praktikum.ingredient import Ingredient 

+

5 

+

6 

+

7class Burger: 

+

8 """ 

+

9 Модель бургера. 

+

10 Бургер состоит из булочек и ингредиентов (начинка или соус). 

+

11 Ингредиенты можно перемещать и удалять. 

+

12 Можно распечать чек с информацией о бургере. 

+

13 """ 

+

14 

+

15 def __init__(self): 

+

16 self.bun = None 

+

17 self.ingredients: List[Ingredient] = [] 

+

18 

+

19 def set_buns(self, bun: Bun): 

+

20 self.bun = bun 

+

21 

+

22 def add_ingredient(self, ingredient: Ingredient): 

+

23 self.ingredients.append(ingredient) 

+

24 

+

25 def remove_ingredient(self, index: int): 

+

26 del self.ingredients[index] 

+

27 

+

28 def move_ingredient(self, index: int, new_index: int): 

+

29 self.ingredients.insert(new_index, self.ingredients.pop(index)) 

+

30 

+

31 def get_price(self) -> float: 

+

32 price = self.bun.get_price() * 2 

+

33 

+

34 for ingredient in self.ingredients: 

+

35 price += ingredient.get_price() 

+

36 

+

37 return price 

+

38 

+

39 def get_receipt(self) -> str: 

+

40 receipt: List[str] = [f'(==== {self.bun.get_name()} ====)'] 

+

41 

+

42 for ingredient in self.ingredients: 

+

43 receipt.append(f'= {str(ingredient.get_type()).lower()} {ingredient.get_name()} =') 

+

44 

+

45 receipt.append(f'(==== {self.bun.get_name()} ====)\n') 

+

46 receipt.append(f'Price: {self.get_price()}') 

+

47 

+

48 return '\n'.join(receipt) 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_database_py.html b/htmlcov/z_c68eb0c7512457e4_database_py.html new file mode 100644 index 000000000..30a1a82db --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_database_py.html @@ -0,0 +1,130 @@ + + + + + Coverage for praktikum\database.py: 100% + + + + + +
+
+

+ Coverage for praktikum\database.py: + 100% +

+ +

+ 21 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1from typing import List 

+

2 

+

3from praktikum.bun import Bun 

+

4from praktikum.ingredient import Ingredient 

+

5from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING 

+

6 

+

7 

+

8class Database: 

+

9 """ 

+

10 Класс с методами по работе с базой данных. 

+

11 """ 

+

12 

+

13 def __init__(self): 

+

14 self.buns: List[Bun] = [] 

+

15 self.ingredients: List[Ingredient] = [] 

+

16 

+

17 self.buns.append(Bun("black bun", 100)) 

+

18 self.buns.append(Bun("white bun", 200)) 

+

19 self.buns.append(Bun("red bun", 300)) 

+

20 

+

21 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "hot sauce", 100)) 

+

22 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "sour cream", 200)) 

+

23 self.ingredients.append(Ingredient(INGREDIENT_TYPE_SAUCE, "chili sauce", 300)) 

+

24 

+

25 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "cutlet", 100)) 

+

26 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "dinosaur", 200)) 

+

27 self.ingredients.append(Ingredient(INGREDIENT_TYPE_FILLING, "sausage", 300)) 

+

28 

+

29 def available_buns(self) -> List[Bun]: 

+

30 return self.buns 

+

31 

+

32 def available_ingredients(self) -> List[Ingredient]: 

+

33 return self.ingredients 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_py.html new file mode 100644 index 000000000..fa0b07159 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_ingredient_py.html @@ -0,0 +1,117 @@ + + + + + Coverage for praktikum\ingredient.py: 100% + + + + + +
+
+

+ Coverage for praktikum\ingredient.py: + 100% +

+ +

+ 11 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1class Ingredient: 

+

2 """ 

+

3 Модель ингредиента. 

+

4 Ингредиент: начинка или соус. 

+

5 У ингредиента есть тип (начинка или соус), название и цена. 

+

6 """ 

+

7 

+

8 def __init__(self, ingredient_type: str, name: str, price: float): 

+

9 self.type = ingredient_type 

+

10 self.name = name 

+

11 self.price = price 

+

12 

+

13 def get_price(self) -> float: 

+

14 return self.price 

+

15 

+

16 def get_name(self) -> str: 

+

17 return self.name 

+

18 

+

19 def get_type(self) -> str: 

+

20 return self.type 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html b/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html new file mode 100644 index 000000000..f409b3bf0 --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_ingredient_types_py.html @@ -0,0 +1,104 @@ + + + + + Coverage for praktikum\ingredient_types.py: 100% + + + + + +
+
+

+ Coverage for praktikum\ingredient_types.py: + 100% +

+ +

+ 2 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1""" 

+

2Перечисление с типами ингредиентов. 

+

3SAUCE – соус 

+

4FILLING – начинка 

+

5""" 

+

6INGREDIENT_TYPE_SAUCE = 'SAUCE' 

+

7INGREDIENT_TYPE_FILLING = 'FILLING' 

+
+ + + diff --git a/htmlcov/z_c68eb0c7512457e4_praktikum_py.html b/htmlcov/z_c68eb0c7512457e4_praktikum_py.html new file mode 100644 index 000000000..81c3deb0e --- /dev/null +++ b/htmlcov/z_c68eb0c7512457e4_praktikum_py.html @@ -0,0 +1,139 @@ + + + + + Coverage for praktikum\praktikum.py: 95% + + + + + +
+
+

+ Coverage for praktikum\praktikum.py: + 95% +

+ +

+ 20 statements   + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.11.0, + created at 2026-01-05 21:19 +0100 +

+ +
+
+
+

1 

+

2from typing import List 

+

3 

+

4from praktikum.bun import Bun 

+

5from praktikum.burger import Burger 

+

6from praktikum.database import Database 

+

7from praktikum.ingredient import Ingredient 

+

8 

+

9 

+

10def main(): 

+

11 # Инициализируем базу данных 

+

12 database: Database = Database() 

+

13 

+

14 # Создадим новый бургер 

+

15 burger: Burger = Burger() 

+

16 

+

17 # Считаем список доступных булок из базы данных 

+

18 buns: List[Bun] = database.available_buns() 

+

19 

+

20 # Считаем список доступных ингредиентов из базы данных 

+

21 ingredients: List[Ingredient] = database.available_ingredients() 

+

22 

+

23 # Соберём бургер 

+

24 burger.set_buns(buns[0]) 

+

25 

+

26 burger.add_ingredient(ingredients[1]) 

+

27 burger.add_ingredient(ingredients[4]) 

+

28 burger.add_ingredient(ingredients[3]) 

+

29 burger.add_ingredient(ingredients[5]) 

+

30 

+

31 # Переместим слой с ингредиентом 

+

32 burger.move_ingredient(2, 1) 

+

33 

+

34 # Удалим ингредиент 

+

35 burger.remove_ingredient(3) 

+

36 

+

37 # Распечатаем рецепт бургера 

+

38 print(burger.get_receipt()) 

+

39 

+

40 

+

41if __name__ == "__main__": 

+

42 main() 

+
+ + +