Skip to content

Commit

Permalink
Clean up tests, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
mportesdev committed Apr 16, 2021
1 parent 3bcd7a6 commit 320f426
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 319 deletions.
2 changes: 1 addition & 1 deletion pictureshow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pictureshow.exceptions import PageSizeError, MarginError, LayoutError
from pictureshow.core import PictureShow, pictures_to_pdf

__version__ = '0.6.1'
__version__ = '0.6.2'

__all__ = ['__version__', 'PictureShow', 'pictures_to_pdf',
'PageSizeError', 'MarginError', 'LayoutError']
15 changes: 15 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from PyPDF2 import PdfFileReader
import pytest

from pictureshow.cli import _number

A4_WIDTH = 72 * 210 / 25.4

PIC_FILE = 'pics/mandelbrot.png'
Expand Down Expand Up @@ -44,6 +46,19 @@ def temp_existing():
pdf_path.unlink()


@pytest.mark.parametrize(
'number, noun, expected',
(
pytest.param(1, 'file', '1 file', id='1 file'),
pytest.param(2, 'file', '2 files', id='2 files'),
pytest.param(1, 'picture', '1 picture', id='3 pictures'),
pytest.param(3, 'page', '3 pages', id='3 pages'),
)
)
def test_number(number, noun, expected):
assert _number(number, noun) == expected


class TestCallsToCore:
"""Test that the command line app calls the underlying function
correctly.
Expand Down
Loading

0 comments on commit 320f426

Please sign in to comment.