diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/requirements.txt | 1 | ||||
| -rwxr-xr-x | tests/test_tablib.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/requirements.txt b/tests/requirements.txt index dc91fc9..8d49fd2 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,5 +5,6 @@ odfpy openpyxl>=2.4.0 pandas pyyaml +tabulate xlrd xlwt diff --git a/tests/test_tablib.py b/tests/test_tablib.py index 5754bb2..8918105 100755 --- a/tests/test_tablib.py +++ b/tests/test_tablib.py @@ -1288,3 +1288,14 @@ class DocTests(unittest.TestCase): import tablib.formats._rst results = doctest.testmod(tablib.formats._rst) self.assertEqual(results.failed, 0) + + +class CliTests(BaseTestCase): + def test_cli_export_github(self): + self.assertEqual('|---|---|---|\n| a | b | c |', tablib.Dataset(['a','b','c']).export('cli', tablefmt='github')) + + def test_cli_export_simple(self): + self.assertEqual('- - -\na b c\n- - -', tablib.Dataset(['a','b','c']).export('cli', tablefmt='simple')) + + def test_cli_export_grid(self): + self.assertEqual('+---+---+---+\n| a | b | c |\n+---+---+---+', tablib.Dataset(['a','b','c']).export('cli', tablefmt='grid')) |
