make pytests
This commit is contained in:
2
.coveragerc
Normal file
2
.coveragerc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[run]
|
||||||
|
omit = tests/*, __init__.py
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
.idea/
|
.idea/
|
||||||
app/
|
app/
|
||||||
|
*/coverage/
|
||||||
*.log
|
*.log
|
||||||
|
.coverage
|
||||||
|
|||||||
@@ -4,3 +4,9 @@ Dies ist die dritte Version von AutoPicture.
|
|||||||
|
|
||||||
# Erste Schritte
|
# Erste Schritte
|
||||||
|
|
||||||
|
# Tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3.10 -m pytest --no-header -rfp --cov --cov-report html:tests/coverage --cov-report xml:tests/coverage/coverage.xml tests/
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
3
pytest.ini
Normal file
3
pytest.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
pythonpath = .
|
||||||
|
addopts = --ignore-glob=**/tests/**
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
import unittest
|
|
||||||
import sys
|
|
||||||
sys.path.append("../")
|
|
||||||
|
|
||||||
from src.exif_data import ExifData
|
from src.exif_data import ExifData
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class TestExifData(unittest.TestCase):
|
class TestExifData(unittest.TestCase):
|
||||||
exif_data = ExifData(image_path="/my/path/lol",
|
def test_exif_data(self):
|
||||||
image_name="Secret.png",
|
exif_data = ExifData(image_path="/path/to/image",
|
||||||
make="SALAMI",
|
image_name="Image.jpeg",
|
||||||
day=10,
|
make="CAMERA",
|
||||||
month=10,
|
month=12,
|
||||||
year=1010,
|
day=12,
|
||||||
time=1237127392
|
year=2023,
|
||||||
)
|
time=1278897213)
|
||||||
|
|
||||||
assert exif_data.name == "Secret.png"
|
assert exif_data.make == "CAMERA"
|
||||||
assert exif_data.make == "SALAMI"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user