mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 10:01:56 +08:00
Test: filesystem/file, filesystem, filesystem/hook, model/file/Create
This commit is contained in:
24
pkg/filesystem/filesystem_test.go
Normal file
24
pkg/filesystem/filesystem_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user