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.
26 lines
429 B
26 lines
429 B
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)
|
|
}
|