mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: failed tests while static files not loaded
This commit is contained in:
@@ -99,6 +99,17 @@ func TestInjectSiteInfo(t *testing.T) {
|
||||
asserts := assert.New(t)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
// 静态资源未加载
|
||||
{
|
||||
TestFunc := InjectSiteInfo()
|
||||
|
||||
c, _ := gin.CreateTestContext(rec)
|
||||
c.Params = []gin.Param{}
|
||||
c.Request, _ = http.NewRequest("GET", "/", nil)
|
||||
TestFunc(c)
|
||||
asserts.False(c.IsAborted())
|
||||
}
|
||||
|
||||
// index.html 不存在
|
||||
{
|
||||
testStatic := &StaticMock{}
|
||||
|
||||
Reference in New Issue
Block a user