提交 5a27642a 编写于 作者: Y yhz

fix test case bug

上级 d3c232a3
......@@ -1300,7 +1300,8 @@ class TestNameInvalid(object):
assert not status.OK()
@pytest.mark.level(2)
def test_add_vectors_with_invalid_tag_name(self, connect, get_tag_name):
def test_add_vectors_with_invalid_tag_name(self, connect, get_table_name, get_tag_name):
table_name = get_table_name
tag_name = get_tag_name
vectors = gen_vectors(1, dim)
status, result = connect.add_vectors(table_name, vectors, partition_tag=tag_name)
......
......@@ -1209,8 +1209,16 @@ class TestCreateIndexParamsInvalid(object):
logging.getLogger().info(index_params)
status, ids = connect.add_vectors(table, vectors)
# if not isinstance(index_type, int) or not isinstance(nlist, int):
with pytest.raises(Exception) as e:
try:
status = connect.create_index(table, index_params)
assert not status.OK()
# no exception raised & status is OK. unexpected.
assert False
except (Exception, ):
pass
# with pytest.raises(Exception) as e:
# status = connect.create_index(table, index_params)
# assert not status.OK()
# else:
# status = connect.create_index(table, index_params)
# assert not status.OK()
......@@ -54,12 +54,12 @@ def gen_long_str(num):
def gen_invalid_ips():
ips = [
"255.0.0.0",
"255.255.0.0",
"255.255.255.0",
"255.255.255.255",
"127.0.0",
"123.0.0.2",
# "255.0.0.0",
# "255.255.0.0",
# "255.255.255.0",
# "255.255.255.255",
# "127.0.0",
# "123.0.0.2",
"12-s",
" ",
"12 s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册