Fix: failed uint test due to dirty cache
This commit is contained in:
parent
5b01202844
commit
4649ddbae2
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,7 @@ package model
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"github.com/DATA-DOG/go-sqlmock"
|
"github.com/DATA-DOG/go-sqlmock"
|
||||||
|
"github.com/HFO4/cloudreve/pkg/cache"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -26,6 +27,7 @@ func TestMain(m *testing.M) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetSettingByType(t *testing.T) {
|
func TestGetSettingByType(t *testing.T) {
|
||||||
|
cache.Store = cache.NewMemoStore()
|
||||||
asserts := assert.New(t)
|
asserts := assert.New(t)
|
||||||
|
|
||||||
//找到设置时
|
//找到设置时
|
||||||
|
@ -57,6 +59,7 @@ func TestGetSettingByType(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetSettingByNames(t *testing.T) {
|
func TestGetSettingByNames(t *testing.T) {
|
||||||
|
cache.Store = cache.NewMemoStore()
|
||||||
asserts := assert.New(t)
|
asserts := assert.New(t)
|
||||||
|
|
||||||
//找到设置时
|
//找到设置时
|
||||||
|
@ -102,6 +105,7 @@ func TestGetSettingByNames(t *testing.T) {
|
||||||
|
|
||||||
// TestGetSettingByName 测试GetSettingByName
|
// TestGetSettingByName 测试GetSettingByName
|
||||||
func TestGetSettingByName(t *testing.T) {
|
func TestGetSettingByName(t *testing.T) {
|
||||||
|
cache.Store = cache.NewMemoStore()
|
||||||
asserts := assert.New(t)
|
asserts := assert.New(t)
|
||||||
|
|
||||||
//找到设置时
|
//找到设置时
|
||||||
|
|
Loading…
Add table
Reference in a new issue