summaryrefslogtreecommitdiff
path: root/tests/test_tablib.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2019-11-12 10:53:20 +0200
committerGitHub <noreply@github.com>2019-11-12 10:53:20 +0200
commit57a535f577379214f415a8deee5fa2ab2c5f2415 (patch)
treecd297a0050be8bf56606f57bb50491a11a8b0814 /tests/test_tablib.py
parent357a5594c55a3a99b7949eed7845e9335cb15248 (diff)
downloadtablib-57a535f577379214f415a8deee5fa2ab2c5f2415.tar.gz
Fix NameError: name '_get_column_widths' is not defined (#433)
* Fix NameError: name '_get_column_widths' is not defined * Also test ReSTFormat.export_set
Diffstat (limited to 'tests/test_tablib.py')
-rwxr-xr-xtests/test_tablib.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_tablib.py b/tests/test_tablib.py
index 61c1f3d..2d8798b 100755
--- a/tests/test_tablib.py
+++ b/tests/test_tablib.py
@@ -660,6 +660,28 @@ class RSTTests(BaseTestCase):
'========== ========= ==='
)
+ def test_rst_export_set(self):
+ # Arrange
+ data = tablib.Dataset()
+ data.append(self.john)
+ data.headers = self.headers
+ fmt = registry.get_format("rst")
+
+ # Act
+ out1 = fmt.export_set(data)
+ out2 = fmt.export_set_as_simple_table(data)
+
+ # Assert
+ self.assertEqual(out1, out2)
+ self.assertEqual(
+ out1,
+ "========== ========= ===\n"
+ "first_name last_name gpa\n"
+ "========== ========= ===\n"
+ "John Adams 90 \n"
+ "========== ========= ===",
+ )
+
class CSVTests(BaseTestCase):
def test_csv_format_detect(self):