summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Santos <dfsantosbu@unal.edu.co>2019-10-30 12:50:33 +0100
committerDaniel Santos <dfsantosbu@unal.edu.co>2019-10-30 12:52:43 +0100
commit19b3d875fddc4e9d4e94741dc9a5b98c76dc9087 (patch)
tree96c06100883dbb6b4bbdb6103b240f40ca847ec4 /tests
parent34fe72305e0a21c40f03cc718bb5346e87e328f2 (diff)
downloadtablib-19b3d875fddc4e9d4e94741dc9a5b98c76dc9087.tar.gz
Implement feature new format: Cli. Generate adapter for tabulate. This close issue #340
Write respective tests.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_tablib.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_tablib.py b/tests/test_tablib.py
index 695d13d..995b225 100755
--- a/tests/test_tablib.py
+++ b/tests/test_tablib.py
@@ -42,7 +42,7 @@ class TablibTestCase(BaseTestCase):
def _test_export_data_in_all_formats(self, dataset, exclude=()):
all_formats = [
'json', 'yaml', 'csv', 'tsv', 'xls', 'xlsx', 'ods', 'html', 'jira',
- 'latex', 'df', 'rst',
+ 'latex', 'df', 'rst', 'cli',
]
for format_ in all_formats:
if format_ in exclude:
@@ -1214,6 +1214,12 @@ class JiraTests(BaseTestCase):
def test_jira_export_empty_dataset(self):
self.assertTrue(tablib.Dataset().jira is not None)
+class CliTests(BasetTestCase):
+ def test_cli_export(self):
+ self.assertEqual('a b c', tablib.Dataset(['a', 'b', 'c']).cli)
+
+ def test_cli_export_github(self):
+ self.assertEqual('|---|---|---|\n| a | b | c |', tablib.Dataset(['a','b','c']).export('cli',tablefmt='github'))
class DocTests(unittest.TestCase):