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

@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from tableprint import humantime, _format_line, LineStyle
from tableprint import humantime, LineStyle
from tableprint.utils import format_line
import pytest
def test_format_line():
# using ASCII
assert _format_line(['foo', 'bar'], LineStyle('(', '_', '+', ')')) == '(foo+bar)'
assert _format_line("abc", LineStyle('[', '*', '.', ']')) == '[a.b.c]'
assert _format_line(["_"], LineStyle('o', '', '!', 'o')) == 'o_o'
assert _format_line([], LineStyle(':', '', '', ')')) == ':)'
assert format_line(['foo', 'bar'], LineStyle('(', '_', '+', ')')) == '(foo+bar)'
assert format_line("abc", LineStyle('[', '*', '.', ']')) == '[a.b.c]'
assert format_line(["_"], LineStyle('o', '', '!', 'o')) == 'o_o'
assert format_line([], LineStyle(':', '', '', ')')) == ':)'
# using unicode
assert _format_line(['.', '.', '.'], LineStyle('', '_', '', '')) == '★...☆'
assert _format_line("☚☛", LineStyle('', '*', '', '')) == '♪☚♩☛♫'
assert format_line(['.', '.', '.'], LineStyle('', '_', '', '')) == '★...☆'
assert format_line("☚☛", LineStyle('', '*', '', '')) == '♪☚♩☛♫'
def test_humantime():