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) }