diff --git a/src/cpl_query/_query/contains_query.py b/src/cpl_query/_query/contains_query.py index e235c65d..47d29dc8 100644 --- a/src/cpl_query/_query/contains_query.py +++ b/src/cpl_query/_query/contains_query.py @@ -1,5 +1,12 @@ +from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument from cpl_query.extension.iterable_abc import IterableABC -def contains_query(_list: IterableABC, value: object) -> bool: - return value in _list +def contains_query(_list: IterableABC, _value: object) -> bool: + if _list is None: + raise ArgumentNoneException(ExceptionArgument.list) + + if _value is None: + raise ArgumentNoneException(ExceptionArgument.value) + + return _value in _list diff --git a/src/cpl_query/exceptions.py b/src/cpl_query/exceptions.py index b0a320ea..c9694221 100644 --- a/src/cpl_query/exceptions.py +++ b/src/cpl_query/exceptions.py @@ -6,6 +6,7 @@ class ExceptionArgument(Enum): list = 'list' func = 'func' type = 'type' + value = 'value' # exceptions