mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
6a13386393
Signed-off-by: XuanYang-cn <xuan.yang@zilliz.com>
35 lines
1010 B
Go
35 lines
1010 B
Go
package datanode
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCollection_newCollection(t *testing.T) {
|
|
collectionName := "collection0"
|
|
collectionID := UniqueID(0)
|
|
collectionMeta := genTestCollectionMeta(collectionName, collectionID)
|
|
|
|
schemaBlob := proto.MarshalTextString(collectionMeta.Schema)
|
|
assert.NotEqual(t, "", schemaBlob)
|
|
|
|
collection := newCollection(collectionMeta.ID, schemaBlob)
|
|
assert.Equal(t, collection.Name(), collectionName)
|
|
assert.Equal(t, collection.ID(), collectionID)
|
|
}
|
|
|
|
func TestCollection_deleteCollection(t *testing.T) {
|
|
collectionName := "collection0"
|
|
collectionID := UniqueID(0)
|
|
collectionMeta := genTestCollectionMeta(collectionName, collectionID)
|
|
|
|
schemaBlob := proto.MarshalTextString(collectionMeta.Schema)
|
|
assert.NotEqual(t, "", schemaBlob)
|
|
|
|
collection := newCollection(collectionMeta.ID, schemaBlob)
|
|
assert.Equal(t, collection.Name(), collectionName)
|
|
assert.Equal(t, collection.ID(), collectionID)
|
|
}
|