mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:20:54 +00:00
fix the cache test
This commit is contained in:
parent
75d28d49c5
commit
d3ab157915
4
cache/cache_test.go
vendored
4
cache/cache_test.go
vendored
@ -15,6 +15,7 @@
|
|||||||
package cache
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -67,7 +68,7 @@ func TestCache(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFileCache(t *testing.T) {
|
func TestFileCache(t *testing.T) {
|
||||||
bm, err := NewCache("file", `{"CachePath":"/cache","FileSuffix":".bin","DirectoryLevel":2,"EmbedExpiry":0}`)
|
bm, err := NewCache("file", `{"CachePath":"cache","FileSuffix":".bin","DirectoryLevel":2,"EmbedExpiry":0}`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("init err")
|
t.Error("init err")
|
||||||
}
|
}
|
||||||
@ -112,4 +113,5 @@ func TestFileCache(t *testing.T) {
|
|||||||
if v := bm.Get("astaxie"); v.(string) != "author" {
|
if v := bm.Get("astaxie"); v.(string) != "author" {
|
||||||
t.Error("get err")
|
t.Error("get err")
|
||||||
}
|
}
|
||||||
|
os.RemoveAll("cache")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user