converting tableprint from a module to a package

This commit is contained in:
Niru Maheswaranathan
2017-05-25 15:02:14 -07:00
parent d7596f611f
commit 6e94c9e99c
10 changed files with 177 additions and 148 deletions

View File

@@ -5,6 +5,7 @@ import pytest
def test_borders():
"""Tests printing of the top and bottom borders"""
# top
assert top(5, width=2, style='round') == '╭──┬──┬──┬──┬──╮'
@@ -16,11 +17,12 @@ def test_borders():
def test_row():
"""Tests printing of a single row of data"""
# valid
assert row("abc", width=3, style='round') == '│ a│ b│ c│'
assert row([1, 2, 3], width=3, style='clean') == ' 1 2 3 '
# invalid
with pytest.raises(ValueError) as context:
with pytest.raises(ValueError):
row([{}])