mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 15:00:19 +00:00
Implement feature that allows to export tabular data suited to a… (#437)
This commit is contained in:
committed by
Hugo van Kemenade
parent
4de2e17984
commit
fa30ea858d
@@ -5,5 +5,6 @@ odfpy
|
||||
openpyxl>=2.4.0
|
||||
pandas
|
||||
pyyaml
|
||||
tabulate
|
||||
xlrd
|
||||
xlwt
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user