1
0
Fork 0
forked from forgejo/forgejo

Add integration test for TrSize

This commit is contained in:
0ko 2024-03-19 18:47:48 +05:00 committed by GitHub
parent 24552ee9ee
commit e5212c8c96
2 changed files with 124 additions and 0 deletions

View file

@ -218,6 +218,16 @@ func (s *TestSession) GetCookie(name string) *http.Cookie {
return nil
}
func (s *TestSession) SetCookie(cookie *http.Cookie) *http.Cookie {
baseURL, err := url.Parse(setting.AppURL)
if err != nil {
return nil
}
s.jar.SetCookies(baseURL, []*http.Cookie{cookie})
return nil
}
func (s *TestSession) MakeRequest(t testing.TB, rw *RequestWrapper, expectedStatus int) *httptest.ResponseRecorder {
t.Helper()
req := rw.Request