def test_create_collection_normal(self, gcon): collection_param = collection_schema_factory() status = gcon.create_collection(collection_param) assert status.OK(), status.message status = gcon.drop_collection(collection_param["collection_name"]) assert status.OK(), status.message
def test_has_collection(self, gcon): param = collection_schema_factory() s = gcon.create_collection(param) assert s.OK() status, flag = gcon.has_collection(param['collection_name']) assert status.OK() and flag
def test_repeat_create_collection(self, gcon): param = collection_schema_factory() gcon.create_collection(param) res = gcon.create_collection(param) LOGGER.error(res) assert not res.OK()
def test_describe_collection_normal(self, gcon): param = collection_schema_factory() gcon.create_collection(param) status, collection = gcon.describe_collection(param['collection_name']) assert status.OK() assert collection.collection_name == param['collection_name'] status, collection = gcon.describe_collection('collection_not_exists') assert not status.OK()
def test_drop_collection_normal(self, gcon): param = collection_schema_factory() s = gcon.create_collection(param) assert s.OK() _, collections = gcon.show_collections() assert param['collection_name'] in collections status = gcon.drop_collection(param['collection_name']) _, collections = gcon.show_collections() assert param['collection_name'] not in collections
def test_create_collection(self, gcon): param = collection_schema_factory() param['collection_name'] = None with pytest.raises(ParamError): gcon.create_collection(param) param = collection_schema_factory() res = gcon.create_collection(param) assert res.OK() assert gcon.has_collection(param['collection_name']) param = collection_schema_factory() param['dimension'] = 'string' with pytest.raises(ParamError): res = gcon.create_collection(param) param = '09998876565' with pytest.raises(ParamError): gcon.create_collection(param) param = collection_schema_factory() param['collection_name'] = 1234456 with pytest.raises(ParamError): gcon.create_collection(param)
def test_create_collection_name_wrong(self, gcon): param = collection_schema_factory() param['collection_name'] = '.....' status = gcon.create_collection(param) LOGGER.error(status) assert not status.OK()
def test_create_collection_normal(self, gcon): param = collection_schema_factory() status = gcon.create_collection(param) assert status.OK()