@@ -264,7 +264,7 @@ def test_delete_table(self, connect, table):
264
264
expected: status ok, and no table in tables
265
265
'''
266
266
status = connect .delete_table (table )
267
- assert not connect . has_table ( table )
267
+ assert not assert_has_table ( connect , table )
268
268
269
269
def test_delete_table_ip (self , connect , ip_table ):
270
270
'''
@@ -274,7 +274,7 @@ def test_delete_table_ip(self, connect, ip_table):
274
274
expected: status ok, and no table in tables
275
275
'''
276
276
status = connect .delete_table (ip_table )
277
- assert not connect . has_table ( ip_table )
277
+ assert not assert_has_table ( connect , ip_table )
278
278
279
279
@pytest .mark .level (2 )
280
280
def test_table_delete_without_connection (self , table , dis_connect ):
@@ -314,7 +314,7 @@ def test_delete_table_repeatedly(self, connect):
314
314
connect .create_table (param )
315
315
status = connect .delete_table (table_name )
316
316
time .sleep (1 )
317
- assert not connect . has_table ( table_name )
317
+ assert not assert_has_table ( connect , table_name )
318
318
319
319
def test_delete_create_table_repeatedly (self , connect ):
320
320
'''
@@ -371,7 +371,7 @@ def _test_delete_table_multiprocessing(self, args):
371
371
def deletetable (milvus ):
372
372
status = milvus .delete_table (table )
373
373
# assert not status.code==0
374
- assert milvus . has_table ( table )
374
+ assert assert_has_table ( milvus , table )
375
375
assert status .OK ()
376
376
377
377
for i in range (process_num ):
@@ -411,11 +411,10 @@ def _test_delete_table_multiprocessing_multitable(self, connect):
411
411
def delete (connect ,ids ):
412
412
i = 0
413
413
while i < loop_num :
414
- # assert connect.has_table(table[ids*8+i])
415
414
status = connect .delete_table (table [ids * process_num + i ])
416
415
time .sleep (2 )
417
416
assert status .OK ()
418
- assert not connect . has_table ( table [ids * process_num + i ])
417
+ assert not assert_has_table ( connect , table [ids * process_num + i ])
419
418
i = i + 1
420
419
421
420
for i in range (process_num ):
@@ -444,7 +443,7 @@ def test_has_table(self, connect):
444
443
'index_file_size' : index_file_size ,
445
444
'metric_type' : MetricType .L2 }
446
445
connect .create_table (param )
447
- assert connect . has_table ( table_name )
446
+ assert assert_has_table ( connect , table_name )
448
447
449
448
def test_has_table_ip (self , connect ):
450
449
'''
@@ -458,7 +457,7 @@ def test_has_table_ip(self, connect):
458
457
'index_file_size' : index_file_size ,
459
458
'metric_type' : MetricType .IP }
460
459
connect .create_table (param )
461
- assert connect . has_table ( table_name )
460
+ assert assert_has_table ( connect , table_name )
462
461
463
462
@pytest .mark .level (2 )
464
463
def test_has_table_without_connection (self , table , dis_connect ):
@@ -468,7 +467,7 @@ def test_has_table_without_connection(self, table, dis_connect):
468
467
expected: has table raise exception
469
468
'''
470
469
with pytest .raises (Exception ) as e :
471
- status = dis_connect . has_table ( table )
470
+ assert_has_table ( dis_connect , table )
472
471
473
472
def test_has_table_not_existed (self , connect ):
474
473
'''
@@ -478,7 +477,7 @@ def test_has_table_not_existed(self, connect):
478
477
expected: False
479
478
'''
480
479
table_name = gen_unique_str ("test_table" )
481
- assert not connect . has_table ( table_name )
480
+ assert not assert_has_table ( connect , table_name )
482
481
483
482
"""
484
483
******************************************************************
@@ -700,7 +699,7 @@ def test_create_table_with_invalid_dimension(self, connect, get_dim):
700
699
'dimension' : dimension ,
701
700
'index_file_size' : index_file_size ,
702
701
'metric_type' : MetricType .L2 }
703
- if isinstance (dimension , int ) and dimension > 0 :
702
+ if isinstance (dimension , int ):
704
703
status = connect .create_table (param )
705
704
assert not status .OK ()
706
705
else :
@@ -778,7 +777,7 @@ def preload_table(connect, **params):
778
777
return status
779
778
780
779
def has (connect , ** params ):
781
- status = connect . has_table ( params ["table_name" ])
780
+ status = assert_has_table ( connect , params ["table_name" ])
782
781
return status
783
782
784
783
def show (connect , ** params ):
0 commit comments