Skip to content

Commit

Permalink
add test_get
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonthegoon committed Jul 19, 2023
1 parent 5c89c28 commit 43b9767
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_tablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ def test_header_slicing(self):
self.assertEqual(self.founders['gpa'],
[self.john[2], self.george[2], self.tom[2]])

def test_get(self):
"""Verify getting rows by index"""

self.assertEqual(self.founders.get(0), self.john)
self.assertEqual(self.founders.get(1), self.george)
self.assertEqual(self.founders.get(2), self.tom)

self.assertEqual(self.founders.get(-1), self.tom)
self.assertEqual(self.founders.get(-2), self.george)
self.assertEqual(self.founders.get(-3), self.john)

self.assertRaises(self.founders.get(3), IndexError)

def test_get_col(self):
"""Verify getting columns by index"""

Expand Down

0 comments on commit 43b9767

Please sign in to comment.