From 70716fdd216755dc4b542df74e95b0e5ac74f0ee Mon Sep 17 00:00:00 2001 From: papisz Date: Wed, 9 Apr 2014 22:35:56 +0200 Subject: CSV custom delimiter support --- test_tablib.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index 6125408..1c160d2 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -401,6 +401,17 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(_csv, data.csv) + def test_csv_import_set_semicolons(self): + """Test for proper output with semicolon separated CSV.""" + data.append(self.john) + data.append(self.george) + data.headers = self.headers + + _csv = data.get_csv(delimiter=';') + + data.set_csv(_csv, delimiter=';') + + self.assertEqual(_csv, data.get_csv(delimiter=';')) def test_csv_import_set_with_spaces(self): """Generate and import CSV set serialization when row values have @@ -415,6 +426,19 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(_csv, data.csv) + def test_csv_import_set_semicolon_with_spaces(self): + """Generate and import semicolon separated CSV set serialization when row values have + spaces.""" + data.append(('Bill Gates', 'Microsoft')) + data.append(('Steve Jobs', 'Apple')) + data.headers = ('Name', 'Company') + + _csv = data.get_csv(delimiter=';') + + data.set_csv(_csv, delimiter=';') + + self.assertEqual(_csv, data.get_csv(delimiter=';')) + def test_tsv_import_set(self): """Generate and import TSV set serialization.""" -- cgit v1.2.1 From a21f8187f8bdbe27434478da45fa58f3e2158268 Mon Sep 17 00:00:00 2001 From: James Douglass Date: Fri, 30 May 2014 17:27:59 -0700 Subject: Adding DBF support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squashing two squashes. Adding DBF support Adding the DBFpy python package The DBFpy package provides basic dbf support for python. Still need to write an interface format file for tablib. Adding DBF format and imports in compat.py Adding DBF format to formats.__init__ DBF format had not been committed to formats.__init__, so I’m adding it. Adding a dbf import test Adding at test to check whether a DBF can be created properly and compare it against a regression binary string. Adding an import_set test (and renaming another) Adding an import_set test that conforms with the other import_set tests for other formats. I’m also adding an export_set function. Fixing system site-packages import Importing dbfpy from tab lib.packages instead of system site packages. Fixing a syntaxError in dbfpy/dbfnew.py Fixing an issue with ending field definitions DBFPY, when writing a DBF, terminates the field definitions with a newline character. When importing a DBF from a stream, however, DBFPY was looking only for the \x0D character rather than the newline. Now we consider both cases. Adding a test for dbf format detection Adding DBF filetype detection tests Adding tests for YAML, JSON, TSV, CSV using the DBF detection function. Handling extra exceptions in dbf detection Adding exception handling for struct.error, an exception that DBFPY raises when trying to unpack a TSV table. Since it’s not a DBF file, we know it’s not a DBF and return False. Fixing an issue with the DBF set exporting test The DBF set export test needed a bit enabled (probably the writeable bit?) before the test would match the regression output. Updating dbf interface Updating the int/float class/type checking in the dbf format file. This allows for python2 and python3 compatibility. Tweaking dbfpy to work with python3 Altering a couple of imports. Updating dbf tests for binary data compatibility Making regression strings binary and improving debug messages for dbf assertion errors. Improving file handling for python 2 and 3 Updating DBF file handling for both python 2 and 3 in the _dbf interface. Adding a (seemingly) functional dbfpy for python3 I’ve made dbfpy python3 compatible! Tests appear to pass. A significant change was made to the format detection test whereby I made the input string a binary (bytes) string. If the string is not a bytes string by the time we try to detect the format, we try to decode the string as utf-8 (which admittedly might not be the safest thing to do) and try to decode anyways. Updating imports for tablib dbf interface Now importing python2 or python3 versions as appropriate. Updating dbf package references in compat.py Cleaning up debugging print statements Updating stream handling in dbf interface Factoring the open() call out of the py3 conditional and removing the temp file before returning the stream value. Adding dbfpy3 init.py I had apparently missed the dbfpy3 init file when committing dbfpy3. Adding dbfpy and dbfpy3 to setup.py's package list Switching test order of formats Putting dbf format testing ahead of TSV. In some of my tests with numeric DBF files, I encountered an issue where the ASCII horizontal tab character (0x09) would appear in a numeric DBF. Because of the order of tabular format imports, though, format detection would recognize it as a TSV and not as a DBF. Adding my name to AUTHORS. Adding a DBF property to tab lib core Documentation includes examples on how to explicitly load a DBF straight from a file and how to load a DBF from a binary string. Also, how to write the binary data to a file. Adding DBF format notes to README Adding exclamation point to DBF section title Matching formatting of XLS section Updating setup.py to match current dev state Setup.py had been updated since I forked the tablib repo, so I’m updating setup.py to match its current structure while still maintaining DBF compatibility. Fixed callable collumn test the test was sending a list instead of a function CORE CONTRIBUTORS :cake: @iurisilvio v0.10.0 WHEELS 3.3, 3.4 makefile for WHEELS v0.10.0 history ALL Separate py2 and py3 packages to avoid installation errors. Fix #151 Running travis and tox with python 3.4. Adding DBF support Adding the DBFpy python package The DBFpy package provides basic dbf support for python. Still need to write an interface format file for tablib. Adding DBF format and imports in compat.py Adding DBF format to formats.__init__ DBF format had not been committed to formats.__init__, so I’m adding it. Adding a dbf import test Adding at test to check whether a DBF can be created properly and compare it against a regression binary string. Adding an import_set test (and renaming another) Adding an import_set test that conforms with the other import_set tests for other formats. I’m also adding an export_set function. Fixing system site-packages import Importing dbfpy from tab lib.packages instead of system site packages. Fixing a syntaxError in dbfpy/dbfnew.py Fixing an issue with ending field definitions DBFPY, when writing a DBF, terminates the field definitions with a newline character. When importing a DBF from a stream, however, DBFPY was looking only for the \x0D character rather than the newline. Now we consider both cases. Adding a test for dbf format detection Adding DBF filetype detection tests Adding tests for YAML, JSON, TSV, CSV using the DBF detection function. Handling extra exceptions in dbf detection Adding exception handling for struct.error, an exception that DBFPY raises when trying to unpack a TSV table. Since it’s not a DBF file, we know it’s not a DBF and return False. Fixing an issue with the DBF set exporting test The DBF set export test needed a bit enabled (probably the writeable bit?) before the test would match the regression output. Updating dbf interface Updating the int/float class/type checking in the dbf format file. This allows for python2 and python3 compatibility. Tweaking dbfpy to work with python3 Altering a couple of imports. Updating dbf tests for binary data compatibility Making regression strings binary and improving debug messages for dbf assertion errors. Improving file handling for python 2 and 3 Updating DBF file handling for both python 2 and 3 in the _dbf interface. Adding a (seemingly) functional dbfpy for python3 I’ve made dbfpy python3 compatible! Tests appear to pass. A significant change was made to the format detection test whereby I made the input string a binary (bytes) string. If the string is not a bytes string by the time we try to detect the format, we try to decode the string as utf-8 (which admittedly might not be the safest thing to do) and try to decode anyways. Updating imports for tablib dbf interface Now importing python2 or python3 versions as appropriate. Updating dbf package references in compat.py Cleaning up debugging print statements Updating stream handling in dbf interface Factoring the open() call out of the py3 conditional and removing the temp file before returning the stream value. Adding dbfpy3 init.py I had apparently missed the dbfpy3 init file when committing dbfpy3. Adding dbfpy and dbfpy3 to setup.py's package list Switching test order of formats Putting dbf format testing ahead of TSV. In some of my tests with numeric DBF files, I encountered an issue where the ASCII horizontal tab character (0x09) would appear in a numeric DBF. Because of the order of tabular format imports, though, format detection would recognize it as a TSV and not as a DBF. Adding my name to AUTHORS. Adding a DBF property to tab lib core Documentation includes examples on how to explicitly load a DBF straight from a file and how to load a DBF from a binary string. Also, how to write the binary data to a file. Adding DBF format notes to README Adding exclamation point to DBF section title Matching formatting of XLS section Updating setup.py to match current dev state Setup.py had been updated since I forked the tablib repo, so I’m updating setup.py to match its current structure while still maintaining DBF compatibility. Fixed callable collumn test the test was sending a list instead of a function CORE CONTRIBUTORS :cake: @iurisilvio v0.10.0 WHEELS 3.3, 3.4 makefile for WHEELS v0.10.0 history ALL Separate py2 and py3 packages to avoid installation errors. Fix #151 Running travis and tox with python 3.4. --- test_tablib.py | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index 78d1045..ba57170 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -450,6 +450,108 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(_tsv, data.tsv) + def test_dbf_import_set(self): + data.append(self.john) + data.append(self.george) + data.headers = self.headers + + _dbf = data.dbf + data.dbf = _dbf + + #self.assertEqual(_dbf, data.dbf) + try: + self.assertEqual(_dbf, data.dbf) + except AssertionError: + index = 0 + so_far = '' + for reg_char, data_char in zip(_dbf, data.dbf): + so_far += chr(data_char) + if reg_char != data_char and index not in [1, 2, 3]: + raise AssertionError('Failing at char %s: %s vs %s %s' % ( + index, reg_char, data_char, so_far)) + index += 1 + + def test_dbf_export_set(self): + """Test DBF import.""" + data.append(self.john) + data.append(self.george) + data.append(self.tom) + data.headers = self.headers + + _regression_dbf = (b'\x03r\x06\x06\x03\x00\x00\x00\x81\x00\xab\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00FIRST_NAME\x00C\x00\x00\x00\x00P\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00LAST_NAME\x00\x00C\x00' + b'\x00\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00GPA\x00\x00\x00\x00\x00\x00\x00\x00N\x00\x00\x00\x00\n' + b'\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\r' + ) + _regression_dbf += b' John' + (b' ' * 75) + _regression_dbf += b' Adams' + (b' ' * 74) + _regression_dbf += b' 90.0000000' + _regression_dbf += b' George' + (b' ' * 73) + _regression_dbf += b' Washington' + (b' ' * 69) + _regression_dbf += b' 67.0000000' + _regression_dbf += b' Thomas' + (b' ' * 73) + _regression_dbf += b' Jefferson' + (b' ' * 70) + _regression_dbf += b' 50.0000000' + _regression_dbf += b'\x1a' + + if is_py3: + # If in python3, decode regression string to binary. + #_regression_dbf = bytes(_regression_dbf, 'utf-8') + #_regression_dbf = _regression_dbf.replace(b'\n', b'\r') + pass + + try: + self.assertEqual(_regression_dbf, data.dbf) + except AssertionError: + index = 0 + found_so_far = '' + for reg_char, data_char in zip(_regression_dbf, data.dbf): + #found_so_far += chr(data_char) + if reg_char != data_char and index not in [1, 2, 3]: + raise AssertionError( + 'Failing at char %s: %s vs %s (found %s)' % ( + index, reg_char, data_char, found_so_far)) + index += 1 + + def test_dbf_format_detect(self): + """Test the DBF format detection.""" + _dbf = (b'\x03r\x06\x03\x03\x00\x00\x00\x81\x00\xab\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00FIRST_NAME\x00C\x00\x00\x00\x00P\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00LAST_NAME\x00\x00C\x00' + b'\x00\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00GPA\x00\x00\x00\x00\x00\x00\x00\x00N\x00\x00\x00\x00\n' + b'\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\r' + ) + _dbf += b' John' + (b' ' * 75) + _dbf += b' Adams' + (b' ' * 74) + _dbf += b' 90.0000000' + _dbf += b' George' + (b' ' * 73) + _dbf += b' Washington' + (b' ' * 69) + _dbf += b' 67.0000000' + _dbf += b' Thomas' + (b' ' * 73) + _dbf += b' Jefferson' + (b' ' * 70) + _dbf += b' 50.0000000' + _dbf += b'\x1a' + + _yaml = '- {age: 90, first_name: John, last_name: Adams}' + _tsv = 'foo\tbar' + _csv = '1,2,3\n4,5,6\n7,8,9\n' + _json = '[{"last_name": "Adams","age": 90,"first_name": "John"}]' + + _bunk = ( + '¡¡¡¡¡¡¡¡£™∞¢£§∞§¶•¶ª∞¶•ªº••ª–º§•†•§º¶•†¥ª–º•§ƒø¥¨©πƒø†ˆ¥ç©¨√øˆ¥≈†ƒ¥ç©ø¨çˆ¥ƒçø¶' + ) + self.assertTrue(tablib.formats.dbf.detect(_dbf)) + self.assertFalse(tablib.formats.dbf.detect(_yaml)) + self.assertFalse(tablib.formats.dbf.detect(_tsv)) + self.assertFalse(tablib.formats.dbf.detect(_csv)) + self.assertFalse(tablib.formats.dbf.detect(_json)) + self.assertFalse(tablib.formats.dbf.detect(_bunk)) + def test_csv_format_detect(self): """Test CSV format detection.""" -- cgit v1.2.1 From f187cef5f45e8e4e59d15b732c6c8307142bb634 Mon Sep 17 00:00:00 2001 From: rabinnankhwa Date: Sat, 30 Aug 2014 23:52:35 +0545 Subject: adding support for creating subset of a dataset. --- test_tablib.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index ba57170..54049b1 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -713,6 +713,26 @@ class TablibTestCase(unittest.TestCase): self.assertTrue(data[0] == new_row) + def test_subset(self): + """Create a subset of a dataset""" + + rows = (0, 2) + columns = ('first_name','gpa') + + data.headers = self.headers + + data.append(self.john) + data.append(self.george) + data.append(self.tom) + + #Verify data is truncated + subset = data.subset(rows=rows, cols=columns) + self.assertEqual(type(subset), tablib.Dataset) + self.assertEqual(subset.headers, list(columns)) + self.assertEqual(subset._data[0].list, ['John', 90]) + self.assertEqual(subset._data[1].list, ['Thomas', 50]) + + def test_formatters(self): """Confirm formatters are being triggered.""" -- cgit v1.2.1 From dca7bc9a7d637cfa6f0f00eaebe8bd0cb4e2d7cd Mon Sep 17 00:00:00 2001 From: Kevin Cherepski Date: Wed, 4 Feb 2015 11:53:14 -0500 Subject: Adding ability to unique all rows in a dataset. --- test_tablib.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index ba57170..ad182ab 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -696,6 +696,25 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(third_row, expected_third) + def test_unique(self): + """Unique Rows.""" + + self.founders.append(self.john) + self.founders.append(self.george) + self.founders.append(self.tom) + self.assertEqual(self.founders[0], self.founders[3]) + self.assertEqual(self.founders[1], self.founders[4]) + self.assertEqual(self.founders[2], self.founders[5]) + self.assertEqual(self.founders.height, 6) + + self.founders.unique() + + self.assertEqual(self.founders[0], self.john) + self.assertEqual(self.founders[1], self.george) + self.assertEqual(self.founders[2], self.tom) + self.assertEqual(self.founders.height, 3) + + def test_wipe(self): """Purge a dataset.""" -- cgit v1.2.1 From 541fba67866833e43b741c50bcfccec914c36834 Mon Sep 17 00:00:00 2001 From: Thomas Roten Date: Sat, 28 Mar 2015 16:14:27 -0400 Subject: Fixes Row slicing. Fixes #184. --- test_tablib.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index ba57170..a1f581c 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -8,6 +8,7 @@ import sys import os import tablib from tablib.compat import markup, unicode, is_py3 +from tablib.core import Row @@ -206,6 +207,18 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(self.founders[2:], [self.tom]) + def test_row_slicing(self): + """Verify Row's __getslice__ method. Issue #184.""" + + john = Row(self.john) + + self.assertEqual(john[:], list(self.john[:])) + self.assertEqual(john[0:], list(self.john[0:])) + self.assertEqual(john[:2], list(self.john[:2])) + self.assertEqual(john[0:2], list(self.john[0:2])) + self.assertEqual(john[0:-1], list(self.john[0:-1])) + + def test_delete(self): """Verify deleting from dataset works.""" -- cgit v1.2.1 From 79dc4524a05e7a89b0e65e9d5b78fa6a56652848 Mon Sep 17 00:00:00 2001 From: Mathias Loesch Date: Wed, 27 Aug 2014 21:08:48 +0200 Subject: Added LaTeX table export format --- test_tablib.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index a1f581c..9c37b8e 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -319,6 +319,67 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(html, d.html) + def test_latex_export(self): + """LaTeX export""" + + expected = """\ +% Note: add \\usepackage{booktabs} to your preamble +% +\\begin{table}[!htbp] + \\centering + \\caption{Founders} + \\begin{tabular}{lrr} + \\toprule + first\\_name & last\\_name & gpa \\\\ + \\cmidrule(r){1-1} \\cmidrule(lr){2-2} \\cmidrule(l){3-3} + John & Adams & 90 \\\\ + George & Washington & 67 \\\\ + Thomas & Jefferson & 50 \\\\ + \\bottomrule + \\end{tabular} +\\end{table} +""" + output = self.founders.latex + self.assertEqual(output, expected) + + + def test_latex_export_empty_dataset(self): + self.assertTrue(tablib.Dataset().latex is not None) + + + def test_latex_export_no_headers(self): + d = tablib.Dataset() + d.append(('one', 'two', 'three')) + self.assertTrue('one' in d.latex) + + + def test_latex_export_caption(self): + d = tablib.Dataset() + d.append(('one', 'two', 'three')) + self.assertFalse('caption' in d.latex) + + d.title = 'Title' + self.assertTrue('\\caption{Title}' in d.latex) + + + def test_latex_export_none_values(self): + headers = ['foo', None, 'bar'] + d = tablib.Dataset(['foo', None, 'bar'], headers=headers) + output = d.latex + self.assertTrue('foo' in output) + self.assertFalse('None' in output) + + + def test_latex_escaping(self): + d = tablib.Dataset(['~', '^']) + output = d.latex + + self.assertFalse('~' in output) + self.assertTrue('textasciitilde' in output) + self.assertFalse('^' in output) + self.assertTrue('textasciicircum' in output) + + def test_unicode_append(self): """Passes in a single unicode character and exports.""" @@ -338,6 +399,7 @@ class TablibTestCase(unittest.TestCase): data.xlsx data.ods data.html + data.latex def test_book_export_no_exceptions(self): -- cgit v1.2.1 From 9b6a73c97c09e8d6c8eae90456c1af2d3b742f22 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 7 Feb 2016 06:29:07 -0500 Subject: fixed stuipid test --- test_tablib.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index d4127b0..ea8ff0a 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -530,7 +530,6 @@ class TablibTestCase(unittest.TestCase): data.headers = ('title', 'body') _csv = data.csv - data.csv = _csv self.assertEqual(_csv, data.csv) @@ -881,18 +880,7 @@ class TablibTestCase(unittest.TestCase): # add another entry to test right field width for # integer self.founders.append(('Old', 'Man', 100500)) - - self.assertEqual( - """ -first_name|last_name |gpa -----------|----------|------ -John |Adams |90 -George |Washington|67 -Thomas |Jefferson |50 -Old |Man |100500 -""".strip(), - unicode(self.founders) - ) + self.assertEqual(u'first_name|last_name |gpa ', unicode(self.founders).split('\n')[0]) def test_databook_add_sheet_accepts_only_dataset_instances(self): -- cgit v1.2.1 From c5920249ded38dc5fe70f22021f4a0dd73dd97cf Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 7 Feb 2016 06:32:10 -0500 Subject: python 3.2 is terrible --- test_tablib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index ea8ff0a..2a4f687 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -880,7 +880,7 @@ class TablibTestCase(unittest.TestCase): # add another entry to test right field width for # integer self.founders.append(('Old', 'Man', 100500)) - self.assertEqual(u'first_name|last_name |gpa ', unicode(self.founders).split('\n')[0]) + self.assertEqual('first_name|last_name |gpa ', unicode(self.founders).split('\n')[0]) def test_databook_add_sheet_accepts_only_dataset_instances(self): -- cgit v1.2.1 From a774789252d41522d4ec8b0e2c212aff4a33904d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 7 Feb 2016 06:40:46 -0500 Subject: /s/unique/remove_duplicates #182 --- test_tablib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index 529b39d..64d1604 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -794,7 +794,7 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(third_row, expected_third) - def test_unique(self): + def test_remove_duplicates(self): """Unique Rows.""" self.founders.append(self.john) @@ -805,7 +805,7 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(self.founders[2], self.founders[5]) self.assertEqual(self.founders.height, 6) - self.founders.unique() + self.founders.remove_duplicates() self.assertEqual(self.founders[0], self.john) self.assertEqual(self.founders[1], self.george) @@ -832,16 +832,16 @@ class TablibTestCase(unittest.TestCase): def test_subset(self): """Create a subset of a dataset""" - + rows = (0, 2) columns = ('first_name','gpa') - + data.headers = self.headers data.append(self.john) data.append(self.george) data.append(self.tom) - + #Verify data is truncated subset = data.subset(rows=rows, cols=columns) self.assertEqual(type(subset), tablib.Dataset) -- cgit v1.2.1