Implement feature that allows to export tabular data suited to a… (#437)

This commit is contained in:
Daniel Santos
2019-12-10 00:04:03 +01:00
committed by Hugo van Kemenade
parent 4de2e17984
commit fa30ea858d
6 changed files with 65 additions and 3 deletions
+1
View File
@@ -5,5 +5,6 @@ odfpy
openpyxl>=2.4.0
pandas
pyyaml
tabulate
xlrd
xlwt
+11
View File
@@ -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'))