mirror of https://github.com/milvus-io/milvus.git
[skip ci] Rename test file and format annotation (#8142)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>pull/8124/head
parent
b1afed4ca8
commit
2de7998477
|
@ -750,9 +750,9 @@ class TestConnectionOperation(TestcaseBase):
|
|||
class TestConnect:
|
||||
|
||||
def local_ip(self, args):
|
||||
'''
|
||||
"""
|
||||
check if ip is localhost or not
|
||||
'''
|
||||
"""
|
||||
if not args["ip"] or args["ip"] == 'localhost' or args["ip"] == "127.0.0.1":
|
||||
return True
|
||||
else:
|
||||
|
@ -760,31 +760,31 @@ class TestConnect:
|
|||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
def test_close_repeatedly(self, dis_connect, args):
|
||||
'''
|
||||
"""
|
||||
target: test disconnect repeatedly
|
||||
method: disconnect a connected client, disconnect again
|
||||
expected: raise an error after disconnected
|
||||
'''
|
||||
"""
|
||||
with pytest.raises(Exception) as e:
|
||||
dis_connect.close()
|
||||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
def test_connect_uri(self, args):
|
||||
'''
|
||||
"""
|
||||
target: test connect with correct uri
|
||||
method: uri format and value are both correct
|
||||
expected: connected is True
|
||||
'''
|
||||
"""
|
||||
uri_value = "tcp://%s:%s" % (args["ip"], args["port"])
|
||||
milvus = get_milvus(args["ip"], args["port"], uri=uri_value, handler=args["handler"])
|
||||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
def test_connect_uri_null(self, args):
|
||||
'''
|
||||
"""
|
||||
target: test connect with null uri
|
||||
method: uri set null
|
||||
expected: connected is True
|
||||
'''
|
||||
"""
|
||||
uri_value = ""
|
||||
if self.local_ip(args):
|
||||
milvus = get_milvus(None, None, uri=uri_value, handler=args["handler"])
|
||||
|
@ -794,11 +794,11 @@ class TestConnect:
|
|||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
def test_connect_with_multiprocess(self, args):
|
||||
'''
|
||||
"""
|
||||
target: test uri connect with multiprocess
|
||||
method: set correct uri, test with multiprocessing connecting
|
||||
expected: all connection is connected
|
||||
'''
|
||||
"""
|
||||
|
||||
def connect():
|
||||
milvus = get_milvus(args["ip"], args["port"], handler=args["handler"])
|
||||
|
@ -812,11 +812,11 @@ class TestConnect:
|
|||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
def test_connect_repeatedly(self, args):
|
||||
'''
|
||||
"""
|
||||
target: test connect repeatedly
|
||||
method: connect again
|
||||
expected: status.code is 0, and status.message shows have connected already
|
||||
'''
|
||||
"""
|
||||
uri_value = "tcp://%s:%s" % (args["ip"], args["port"])
|
||||
milvus = Milvus(uri=uri_value, handler=args["handler"])
|
||||
milvus = Milvus(uri=uri_value, handler=args["handler"])
|
||||
|
@ -857,11 +857,11 @@ class TestConnectPortInvalid(object):
|
|||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
@pytest.mark.timeout(CONNECT_TIMEOUT)
|
||||
def test_connect_with_invalid_port(self, args, get_invalid_port):
|
||||
'''
|
||||
"""
|
||||
target: test ip:port connect with invalid port value
|
||||
method: set port in gen_invalid_ports
|
||||
expected: connected is False
|
||||
'''
|
||||
"""
|
||||
port = get_invalid_port
|
||||
with pytest.raises(Exception) as e:
|
||||
milvus = get_milvus(args["ip"], port, args["handler"])
|
||||
|
@ -882,11 +882,11 @@ class TestConnectURIInvalid(object):
|
|||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
@pytest.mark.timeout(CONNECT_TIMEOUT)
|
||||
def test_connect_with_invalid_uri(self, get_invalid_uri, args):
|
||||
'''
|
||||
"""
|
||||
target: test uri connect with invalid uri value
|
||||
method: set port in gen_invalid_uris
|
||||
expected: connected is False
|
||||
'''
|
||||
"""
|
||||
uri_value = get_invalid_uri
|
||||
with pytest.raises(Exception) as e:
|
||||
milvus = get_milvus(uri=uri_value, handler=args["handler"])
|
Loading…
Reference in New Issue