Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
praktikum.py
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Виртуальное окружение
venv/

# Кэш Python
__pycache__/
*.pyc

# Pytest
.pytest_cache/

# IDE
.idea/
.vscode/

.coverage
4 changes: 2 additions & 2 deletions burger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List

from praktikum.bun import Bun
from praktikum.ingredient import Ingredient
from bun import Bun
from ingredient import Ingredient


class Burger:
Expand Down
23 changes: 23 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from unittest.mock import Mock
import pytest

@pytest.fixture
def mock_bun():
bun = Mock()
bun.get_price.return_value = 100
bun.get_name.return_value = "black bun"
return bun

@pytest.fixture
def mock_ingredients():
ing1 = Mock()
ing1.get_price.return_value = 50
ing1.get_name.return_value = "ketchup"
ing1.get_type.return_value = "SAUCE"

ing2 = Mock()
ing2.get_price.return_value = 30
ing2.get_name.return_value = "cutlet"
ing2.get_type.return_value = "FILLING"

return [ing1, ing2]
6 changes: 3 additions & 3 deletions database.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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
from bun import Bun
from ingredient import Ingredient
from ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING


class Database:
Expand Down
2 changes: 2 additions & 0 deletions htmlcov/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 97 additions & 0 deletions htmlcov/__init___py.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions htmlcov/bun_py.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading