Fix: policy should be re-dispatch while getting thumbnails

This commit is contained in:
HFO4
2020-01-02 13:10:04 +08:00
parent a75be3a927
commit b6102c3ae5
10 changed files with 111 additions and 14 deletions

View File

@ -166,3 +166,21 @@ func TestGetSiteURL(t *testing.T) {
asserts.Equal("https://cloudreve.org", siteURL.String())
}
}
func TestGetIntSetting(t *testing.T) {
asserts := assert.New(t)
// 正常
{
cache.Set("setting_TestGetIntSetting", "10", 0)
res := GetIntSetting("TestGetIntSetting", 20)
asserts.Equal(10, res)
}
// 使用默认值
{
res := GetIntSetting("TestGetIntSetting_2", 20)
asserts.Equal(20, res)
}
}