Esempio n. 1
0
    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)
Esempio n. 2
0
 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()
Esempio n. 3
0
 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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
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
Esempio n. 7
0
 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