From a44d0dafa1475679d6c715db042e35122ce3b919 Mon Sep 17 00:00:00 2001 From: Niru Maheswaranathan Date: Fri, 7 Oct 2016 11:50:50 -0700 Subject: [PATCH] Adds a small test for the hr() function --- tests/test_io.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_io.py b/tests/test_io.py index 50f1037..65b367d 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals -from tableprint import table, banner, dataframe +from tableprint import table, banner, dataframe, hr from io import StringIO import numpy as np @@ -7,7 +7,7 @@ import numpy as np def test_table(): output = StringIO() - table([[1, 2, 3], [4, 5 ,6]], "ABC", style='round', width=5, out=output) + table([[1, 2, 3], [4, 5, 6]], 'ABC', style='round', width=5, out=output) assert output.getvalue() == '╭─────┬─────┬─────╮\n│ A │ B │ C │\n├─────┼─────┼─────┤\n│ 1│ 2│ 3│\n│ 4│ 5│ 6│\n╰─────┴─────┴─────╯\n' output = StringIO() @@ -41,3 +41,10 @@ def test_banner(): output = StringIO() banner('!', style='banner', width=1, out=output) assert output.getvalue() == '╒═╕\n│!│\n╘═╛\n' + + +def test_hr(): + + output = hr(1, width=11) + assert len(output) == 11 + assert '───────────'