Cloudreve/pkg/filesystem/filesystem_test.go
2019-11-22 14:56:46 +08:00

25 lines
429 B
Go

package filesystem
import (
model "github.com/HFO4/cloudreve/models"
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewFileSystem(t *testing.T) {
asserts := assert.New(t)
user := model.User{
Policy: model.Policy{
Type: "local",
},
}
fs, err := NewFileSystem(&user)
asserts.NoError(err)
asserts.NotNil(fs.Handler)
user.Policy.Type = "unknown"
fs, err = NewFileSystem(&user)
asserts.Error(err)
}