You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
376 B
18 lines
376 B
3 years ago
|
package cluster
|
||
|
|
||
|
import (
|
||
|
model "github.com/cloudreve/Cloudreve/v3/models"
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestNewNodeFromDBModel(t *testing.T) {
|
||
|
a := assert.New(t)
|
||
|
a.IsType(&SlaveNode{}, NewNodeFromDBModel(&model.Node{
|
||
|
Type: model.SlaveNodeType,
|
||
|
}))
|
||
|
a.IsType(&MasterNode{}, NewNodeFromDBModel(&model.Node{
|
||
|
Type: model.MasterNodeType,
|
||
|
}))
|
||
|
}
|