Test: moveOrCopyFolder / File

This commit is contained in:
HFO4
2019-12-04 13:49:28 +08:00
parent 362a7c389d
commit 5d50e7ed1e
8 changed files with 460 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package middleware
import (
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"testing"
@ -9,10 +10,19 @@ import (
func TestSession(t *testing.T) {
asserts := assert.New(t)
handler := Session("2333")
asserts.NotNil(handler)
asserts.NotNil(Store)
asserts.IsType(emptyFunc(), handler)
{
handler := Session("2333")
asserts.NotNil(handler)
asserts.NotNil(Store)
asserts.IsType(emptyFunc(), handler)
}
{
conf.RedisConfig.Server = "123"
asserts.Panics(func() {
Session("2333")
})
}
}
func emptyFunc() gin.HandlerFunc {