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
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
source = praktikum
omit =
praktikum/praktikum.py
*/__pycache__/*
*/.pytest_cache/*
tests/*

[report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if __name__ == .__main__.:
raise AssertionError
raise NotImplementedError
pass
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
__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

*.manifest
*.spec

pip-log.txt
pip-delete-this-directory.txt

htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
reports/

htmlcov/
coverage_html_report/
.coverage.*
*.cover
*.py,cover

allure-results/
allure-report/

logs/
*.log

.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*

.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store
.project
.classpath
.pydevproject
.settings/

.idea/
*.iml
.vscode/
*.code-workspace
.ipynb_checkpoints/
*.ipynb

*.pyc
*.pyo
*.pyd

venv/
env/
.virtualenv/
virtualenv/

*.db
*.sqlite
*.sqlite3

praktikum/__pycache__/
tests/__pycache__/

tmp/
temp/
*.tmp
*.temp

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/

downloads/
*.part

*.pid
docker-compose.override.yml
Dockerfile.dev

*.orig
*.patch
*.merge
*.rej

*.secret
config/local.py
secrets.toml
coverage_reports/
test_reports/

pytest.local.ini
.coverage.local

*.bak
*.backup

.python-version
.poetry.lock
poetry.lock.bak

test_output/
test-results/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==9.0.2
pytest-cov==6.0.0
Empty file added tests/__init__.py
Empty file.
47 changes: 47 additions & 0 deletions tests/test_bun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import pytest
import sys
import os

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from praktikum.bun import Bun


class TestBun:

@pytest.mark.parametrize("name, price", [
("black bun", 100),
("white bun", 200),
("red bun", 300),
("", 0),
("test bun", 150.5),
])

def test_init(self, name, price):

bun = Bun(name, price)
assert bun.name == name
assert bun.price == price

@pytest.mark.parametrize("name, price", [
("black bun", 100),
("white bun", 200),
("red bun", 300),
])

def test_get_name(self, name, price):

bun = Bun(name, price)
assert bun.get_name() == name

@pytest.mark.parametrize("name, price", [
("black bun", 100),
("white bun", 200),
("red bun", 300),
("test bun", 150.5),
])

def test_get_price(self, name, price):

bun = Bun(name, price)
assert bun.get_price() == price
Loading