Modify test cases of connection error (#19977)

Signed-off-by: nico <cheng.yuan@zilliz.com>

Signed-off-by: nico <cheng.yuan@zilliz.com>
pull/19969/head
NicoYuan1986 2022-10-21 17:11:29 +08:00 committed by GitHub
parent 97f674cff0
commit fb02930be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -197,6 +197,7 @@ class CheckTasks:
check_merge_compact = "check_merge_compact" check_merge_compact = "check_merge_compact"
check_role_property = "check_role_property" check_role_property = "check_role_property"
check_permission_deny = "check_permission_deny" check_permission_deny = "check_permission_deny"
check_value_equal = "check_value_equal"
class BulkLoadStates: class BulkLoadStates:

View File

@ -871,9 +871,10 @@ class TestConnectIPInvalid(TestcaseBase):
method: set host in get_not_string method: set host in get_not_string
expected: connected is False expected: connected is False
""" """
err_msg = cem.FailConnect % (host, port) err_msg = "Type of 'host' must be str."
self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=host, port=port, check_task=ct.CheckTasks.ccr, self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=host, port=port,
check_items={ct.err_code: -1, ct.err_msg: err_msg}) check_task=ct.CheckTasks.check_value_equal,
check_items={ct.err_code: 1, ct.err_msg: err_msg})
class TestConnectPortInvalid(TestcaseBase): class TestConnectPortInvalid(TestcaseBase):
@ -889,9 +890,10 @@ class TestConnectPortInvalid(TestcaseBase):
method: set port in get_not_string method: set port in get_not_string
expected: connected is False expected: connected is False
""" """
err_msg = cem.FailConnect % (host, str(port)) err_msg = "Type of 'host' must be str."
self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=host, port=port, check_task=ct.CheckTasks.ccr, self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=host, port=port,
check_items={ct.err_code: -1, ct.err_msg: err_msg}) check_task=ct.CheckTasks.check_value_equal,
check_items={ct.err_code: 1, ct.err_msg: err_msg})
class TestConnectUriInvalid(TestcaseBase): class TestConnectUriInvalid(TestcaseBase):