Skip to content

Commit

Permalink
Complete test coverage (again again)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jul 21, 2018
1 parent a67e7b5 commit 4e0d433
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.8.0 (in development)
-----------------------

v0.7.0 (2017-07-18)
-------------------
- Added a `len_func` option, allowing the user to specify a custom function for
Expand Down
21 changes: 18 additions & 3 deletions test/test_border_style.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
from six import text_type
from txtble import (
import pytest
from six import text_type
from txtble import (
Txtble,
ASCII_BORDERS, ASCII_EQ_BORDERS,
LIGHT_BORDERS, HEAVY_BORDERS, DOUBLE_BORDERS,
DOT_BORDERS,
)
from test_data import HEADERS, DATA, TABLE
from test_data import HEADERS, DATA, TABLE

def test_ascii_border_style():
tbl = Txtble(DATA, headers=HEADERS, border_style=ASCII_BORDERS)
Expand Down Expand Up @@ -296,3 +297,17 @@ def test_border_style_mixed_overrides():
u'⋮December Turquoise Narcissus ⋮\n'
u'·⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯·'
)

@pytest.mark.parametrize('border_style', [
None,
False,
True,
tuple('-|+++++++++'),
])
def test_bad_border_style(border_style):
tbl = Txtble(DATA, border_style=border_style)
with pytest.raises(
TypeError,
match='border_style must be a BorderStyle instance',
):
str(tbl)
2 changes: 1 addition & 1 deletion txtble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .errors import IndeterminateWidthError, UnterminatedColorError
from .util import with_color_stripped

__version__ = '0.7.0'
__version__ = '0.8.0.dev1'
__author__ = 'John Thorvald Wodder II'
__author_email__ = '[email protected]'
__license__ = 'MIT'
Expand Down
2 changes: 1 addition & 1 deletion txtble/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ def first_style(*args):
for a in args:
if isinstance(a, BorderStyle):
return a
return None
raise TypeError('border_style must be a BorderStyle instance')

0 comments on commit 4e0d433

Please sign in to comment.