summaryrefslogtreecommitdiff
path: root/test_tablib.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_tablib.py')
-rwxr-xr-xtest_tablib.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test_tablib.py b/test_tablib.py
index 8687473..f203179 100755
--- a/test_tablib.py
+++ b/test_tablib.py
@@ -351,6 +351,19 @@ class TablibTestCase(unittest.TestCase):
self.assertEqual(tablib.detect(_json)[0], tablib.formats.json)
self.assertEqual(tablib.detect(_bunk)[0], None)
+ def test_transpose(self):
+ """Transpose a dataset."""
+
+ transposed_founders = self.founders.transpose()
+ first_row = transposed_founders[0]
+ second_row = transposed_founders[1]
+
+ self.assertEqual(transposed_founders.headers,
+ ["first_name","John", "George", "Thomas"])
+ self.assertEqual(first_row,
+ ("last_name","Adams", "Washington", "Jefferson"))
+ self.assertEqual(second_row,
+ ("gpa",90, 67, 50))
def test_wipe(self):
"""Purge a dataset."""