diff options
| author | Thomas Roten <thomas@roten.us> | 2015-03-28 16:14:27 -0400 |
|---|---|---|
| committer | Thomas Roten <thomas@roten.us> | 2015-03-28 16:14:27 -0400 |
| commit | 541fba67866833e43b741c50bcfccec914c36834 (patch) | |
| tree | 6ebb73bd165144a9f7bc3fc53fe09502219ca1d1 /test_tablib.py | |
| parent | 2fbda0f43ddf1d2f3a2fe88b9320b8d04f449d4d (diff) | |
| download | tablib-541fba67866833e43b741c50bcfccec914c36834.tar.gz | |
Fixes Row slicing. Fixes #184.
Diffstat (limited to 'test_tablib.py')
| -rwxr-xr-x | test_tablib.py | 13 |
1 files changed, 13 insertions, 0 deletions
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.""" |
