diff options
| author | Daniel Santos <dfsantosbu@unal.edu.co> | 2019-12-10 00:04:03 +0100 |
|---|---|---|
| committer | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2019-12-10 01:04:03 +0200 |
| commit | fa30ea858d0ac41f2f542e0c50d9f9a2e343deb2 (patch) | |
| tree | 43b8ec6362e4989a9b6669f82d1e15426d3f5f40 /tests/test_tablib.py | |
| parent | 4de2e17984165400bc8aa610ea61c9f441ccbedb (diff) | |
| download | tablib-fa30ea858d0ac41f2f542e0c50d9f9a2e343deb2.tar.gz | |
Implement feature that allows to export tabular data suited to a… (#437)
Diffstat (limited to 'tests/test_tablib.py')
| -rwxr-xr-x | tests/test_tablib.py | 11 |
1 files changed, 11 insertions, 0 deletions
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')) |
