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
Binary file added .coverage
Binary file not shown.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

venv/
env/
.venv/
.ENV/

__pycache__/
*.pyc
*.pyo
*.pyd

*.log

.idea/ # IntelliJ IDEA / PyCharm
.vscode/ # Visual Studio Code
*.sublime-workspace
*.sublime-project


*.sublime-settings
*.kate
*.kate-sessional

.DS_Store # macOS
Thumbs.db # Windows

build/
dist/
*.egg-info/
.eggs/

*.bak
*.tmp
*.swp

.mypy_cache/
*.mypy_cache/
.pytest_cache/
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@

### Структура проекта

- `praktikum` - пакет, содержащий код программы
- `tests` - пакет, содержащий тесты, разделенные по классам. Например, `bun_test.py`, `burger_test.py` и т.д.
├── praktikum - #пакет, содержащий код программы
├── tests # Автотесты
│ ├── test_bun.py`
│ ├── test_burger.py
│ ├── test_database.py
│ └── test_ingredient.py
├── data.py # тестовые данные
├── conftest.py # фикстуры
├── requirements.txt # Зависимости проекта
├── htmlcov # отчеты о покрытии
└── README.md # Документация

### Запуск автотестов

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


@pytest.fixture
def db():
return Database()


@pytest.fixture
def mock_bun():
return Mock()


@pytest.fixture
def mock_ingredient():
return Mock()
15 changes: 15 additions & 0 deletions data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from praktikum.ingredient_types import INGREDIENT_TYPE_SAUCE, INGREDIENT_TYPE_FILLING


class Data:

BUN_NAME = 'Лунная булка'
BUN_PRICE = 1234.00
INGREDIENT_TYPE = INGREDIENT_TYPE_SAUCE
INGREDIENT_NAME = 'Марсианский острый'
INGREDIENT_PRICE = 99.00
MOCK_BUN_NAME = 'Мерцающий коржик'
MOCK_BUN_PRICE = 4321.00
MOCK_INGREDIENT_TYPE = INGREDIENT_TYPE_FILLING
MOCK_INGREDIENT_NAME = 'Астросыр'
MOCK_INGREDIENT_PRICE = 666.00
221 changes: 221 additions & 0 deletions htmlcov/class_index.html

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

Loading