summaryrefslogtreecommitdiff
path: root/test_tablib.py
diff options
context:
space:
mode:
authorJosh Ourisman <josh@joshourisman.com>2010-10-01 16:17:04 -0400
committerJosh Ourisman <josh@joshourisman.com>2010-10-01 16:17:04 -0400
commit149bafa97b3c93b5116090d2834f0c19e6face95 (patch)
tree92093fdfb234913153fed618ca9947ff8423023b /test_tablib.py
parent9f7fec23793b25c7aeffcee4186d6009dc816cca (diff)
downloadtablib-149bafa97b3c93b5116090d2834f0c19e6face95.tar.gz
added ability to append new column passing a callable as the value that will be applied to every row; w/ test
Diffstat (limited to 'test_tablib.py')
-rwxr-xr-xtest_tablib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test_tablib.py b/test_tablib.py
index 67b693d..a315642 100755
--- a/test_tablib.py
+++ b/test_tablib.py
@@ -102,6 +102,13 @@ class TablibTestCase(unittest.TestCase):
self.assertRaises(tablib.InvalidDimensions, data.append, col=new_col)
+ def test_add_callable_column(self):
+ """Verify adding column with values specified as callable."""
+ new_col = ['first_again', lambda x: x[0]]
+ self.founders.append(col=new_col)
+
+ self.assertTrue(map(lambda x: x[0] == x[-1], self.founders))
+
def test_header_slicing(self):
"""Verify slicing by headers."""