Consistent error wrapping (#30600)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
64ff2434ee
Коммит
354d7aeb72
@@ -10,7 +10,6 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -68,7 +67,7 @@ func TestPostActionInvalidURL(t *testing.T) {
|
||||
|
||||
_, err = th.App.DoPostActionWithCookie(th.Context, post.Id, attachments[0].Actions[0].Id, th.BasicUser.Id, "", nil)
|
||||
require.NotNil(t, err)
|
||||
require.True(t, strings.Contains(err.Error(), "missing protocol scheme"))
|
||||
assert.ErrorContains(t, err, "missing protocol scheme")
|
||||
}
|
||||
|
||||
func TestPostActionEmptyResponse(t *testing.T) {
|
||||
@@ -168,7 +167,7 @@ func TestPostActionEmptyResponse(t *testing.T) {
|
||||
|
||||
_, err = th.App.DoPostActionWithCookie(th.Context, post.Id, attachments[0].Actions[0].Id, th.BasicUser.Id, "", nil)
|
||||
require.NotNil(t, err)
|
||||
assert.Contains(t, err.DetailedError, "context deadline exceeded")
|
||||
assert.ErrorContains(t, err, "context deadline exceeded")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -331,7 +330,7 @@ func TestPostAction(t *testing.T) {
|
||||
|
||||
_, err = th.App.DoPostActionWithCookie(th.Context, post.Id, attachments[0].Actions[0].Id, th.BasicUser.Id, "", nil)
|
||||
require.NotNil(t, err)
|
||||
require.True(t, strings.Contains(err.Error(), "address forbidden"))
|
||||
assert.ErrorContains(t, err, "address forbidden")
|
||||
|
||||
interactivePostPlugin := model.Post{
|
||||
Message: "Interactive post",
|
||||
@@ -417,7 +416,7 @@ func TestPostAction(t *testing.T) {
|
||||
|
||||
_, err = th.App.DoPostActionWithCookie(th.Context, postSiteURL.Id, attachmentsSiteURL[0].Actions[0].Id, th.BasicUser.Id, "", nil)
|
||||
require.NotNil(t, err)
|
||||
require.False(t, strings.Contains(err.Error(), "address forbidden"))
|
||||
assert.ErrorContains(t, err, "connection refused")
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ServiceSettings.SiteURL = ts.URL + "/subpath"
|
||||
|
||||
Ссылка в новой задаче
Block a user