Added tests for select & select many

This commit is contained in:
2022-09-12 17:58:48 +02:00
parent dbe1d37046
commit a528511732
2 changed files with 52 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ class IterableABC(ABC, list):
"""
pass
def extend(self, __iterable: Iterable) -> None:
def extend(self, __iterable: Iterable) -> 'IterableABC':
r"""Adds elements of given list to list
Parameter
@@ -169,6 +169,8 @@ class IterableABC(ABC, list):
for value in __iterable:
self.append(value)
return self
@abstractmethod
def last(self) -> any:
r"""Returns last element
@@ -290,6 +292,24 @@ class IterableABC(ABC, list):
"""
pass
def select(self, _f: Callable) -> 'IterableABC':
r"""Formats each element of list to a given format
Returns
-------
:class: `cpl_query.extension.iterable_abc.IterableABC`
"""
pass
def select_many(self, _f: Callable) -> 'IterableABC':
r"""Flattens resulting lists to one
Returns
-------
:class: `cpl_query.extension.iterable_abc.IterableABC`
"""
pass
@abstractmethod
def single(self) -> any:
r"""Returns one single element of list