def test_false_vector(self, gcon): param = { 'table_name': fake.table_name(), 'query_records': records_factory(dim, nq), 'top_k': 'string', 'nprobe': 10 } with pytest.raises(ParamError): gcon.search(**param) param = { 'table_name': fake.table_name(), 'query_records': records_factory(dim, nq), 'top_k': 'string', 'nprobe': 10 } with pytest.raises(ParamError): gcon.search(**param) param = { 'table_name': fake.table_name(), 'query_records': records_factory(dim, nq), 'top_k': random.randint(1, 10), 'nprobe': 10, 'query_ranges': ['false_date_format'] } with pytest.raises(ParamError): gcon.search(**param)
def test_false_insert(self, gcon): param = { 'table_name': fake.table_name(), 'records': records_factory(dim, nq) } res, ids = gcon.insert(**param) assert not res.OK()
def test_table_schema(self): param = { 'table_name': fake.table_name(), 'dimension': random.randint(0, 999), 'index_file_size': 1024, 'metric_type': MetricType.L2 } res = Prepare.table_schema(param) assert isinstance(res, milvus_pb2.TableSchema)
def test_false_vector(self, gcon): param = { 'table_name': fake.table_name(), 'query_records': records_factory(dim, nq), 'top_k': 'string', 'nprobe': 10 } with pytest.raises(ParamError): gcon.search(**param) param = { 'table_name': fake.table_name(), 'query_records': records_factory(dim, nq), 'top_k': 'string', 'nprobe': 10 } with pytest.raises(ParamError): gcon.search(**param)
def test_has_table(self, gcon, gtable): table_name = fake.table_name() status, result = gcon.has_table(table_name) assert status.OK() assert not result result = gcon.has_table(gtable) assert result with pytest.raises(Exception): gcon.has_table(1111)
def gtable(request, gcon): table_name = fake.table_name() dim = getattr(request.module, "dim", 128) param = {'table_name': table_name, 'dimension': dim, 'index_file_size': 1024, 'metric_type': MetricType.L2 } gcon.create_table(param) def teardown(): status, table_names = gcon.show_tables() for name in table_names: gcon.delete_table(name) request.addfinalizer(teardown) return table_name
def test_false_decribe_table(self, gcon): table_name = fake.table_name() res, table_schema = gcon.describe_table(table_name) assert not res.OK() assert not table_schema