More tests for selectors

This commit is contained in:
Marcus Boyd
2020-12-19 15:19:04 +10:30
parent 2d3fc607e6
commit 88714975ff
2 changed files with 47 additions and 4 deletions

View File

@ -312,7 +312,7 @@ class _NthSelector(Selector):
"""
if len(objectlist) == 0:
# nothing to filter
return []
raise ValueError("Can not return the Nth element of an empty list")
clustered = self.cluster(objectlist)
if not self.directionMax:
clustered.reverse()
@ -337,8 +337,6 @@ class _NthSelector(Selector):
"""
Clusters the elements of objectlist if they are within tolerance.
"""
if len(objectlist) == 0:
return []
key_and_obj = []
for obj in objectlist:
# Need to handle value errors, such as what occurs when you try to