diff --git a/tests/python_client/base/collection_wrapper.py b/tests/python_client/base/collection_wrapper.py index 2c915a1809..f7b99c8464 100644 --- a/tests/python_client/base/collection_wrapper.py +++ b/tests/python_client/base/collection_wrapper.py @@ -7,10 +7,11 @@ from utils.api_request import api_request from utils.util_log import test_log as log TIMEOUT = 20 -#keep small timeout for stability tests -#TIMEOUT = 5 +# keep small timeout for stability tests +# TIMEOUT = 5 + class ApiCollectionWrapper: collection = None @@ -147,7 +148,8 @@ class ApiCollectionWrapper: func_name = sys._getframe().f_code.co_name res, check = api_request([self.collection.drop_partition, partition_name], **kwargs) - check_result = ResponseChecker(res, func_name, check_task, check_items, check, partition_name=partition_name, **kwargs).run() + check_result = ResponseChecker(res, func_name, check_task, check_items, check, partition_name=partition_name, + **kwargs).run() return res, check_result def create_partition(self, partition_name, check_task=None, check_items=None, description=""): @@ -218,3 +220,10 @@ class ApiCollectionWrapper: res, check = api_request([self.collection.alter_alias, alias_name], **kwargs) check_result = ResponseChecker(res, func_name, check_task, check_items, check, **kwargs).run() return res, check_result + + def delete(self, expr, partition_name=None, timeout=None, check_task=None, check_items=None, **kwargs): + timeout = TIMEOUT if timeout is None else timeout + func_name = sys._getframe().f_code.co_name + res, check = api_request([self.collection.delete, expr, partition_name, timeout], **kwargs) + check_result = ResponseChecker(res, func_name, check_task, check_items, check, **kwargs).run() + return res, check_result