mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
4015d7245d
Signed-off-by: neza2017 <yefu.chen@zilliz.com>
35 lines
1011 B
Go
35 lines
1011 B
Go
package writenode
|
|
|
|
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)
|
|
}
|