Skip to content

Commit

Permalink
len_slice: Test more unknown length cases
Browse files Browse the repository at this point in the history
Add some more tests to make sure a better variety of cases are verified
to raise an unknown length error.
  • Loading branch information
jakirkham committed Jan 17, 2017
1 parent 6497c23 commit 8ff9945
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ def test_len_slice(self):
with self.assertRaises(measure.UnknownSliceLengthException):
measure.len_slice(slice(None))

with self.assertRaises(measure.UnknownSliceLengthException):
measure.len_slice(slice(0, -1, 1))

with self.assertRaises(measure.UnknownSliceLengthException):
measure.len_slice(slice(None, None, -1))

with self.assertRaises(measure.UnknownSliceLengthException):
measure.len_slice(slice(-1, 1, -1))

for size in [10, 11, 12]:
excess = size + 3
each_range = range(size)
Expand Down

0 comments on commit 8ff9945

Please sign in to comment.