Migrate tests from "api4/team_test.go" to use testify (#12902)
Этот коммит содержится в:
коммит произвёл
Ben Schumacher
родитель
ae78449a20
Коммит
111d076a86
@@ -574,7 +574,9 @@ func CheckEtag(t *testing.T, data interface{}, resp *model.Response) {
|
|||||||
func CheckNoError(t *testing.T, resp *model.Response) {
|
func CheckNoError(t *testing.T, resp *model.Response) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
require.Nil(t, resp.Error)
|
if resp.Error != nil {
|
||||||
|
require.FailNow(t, "Expected no error, got %q", resp.Error.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkHTTPStatus(t *testing.T, resp *model.Response, expectedStatus int, expectError bool) {
|
func checkHTTPStatus(t *testing.T, resp *model.Response, expectedStatus int, expectError bool) {
|
||||||
@@ -637,8 +639,8 @@ func CheckInternalErrorStatus(t *testing.T, resp *model.Response) {
|
|||||||
func CheckErrorMessage(t *testing.T, resp *model.Response, errorId string) {
|
func CheckErrorMessage(t *testing.T, resp *model.Response, errorId string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
require.NotNil(t, resp.Error)
|
require.NotNilf(t, resp.Error, "should have errored with message: %s", errorId)
|
||||||
require.Equal(t, resp.Error.Id, errorId, "incorrect error message")
|
require.Equalf(t, resp.Error.Id, errorId, "incorrect error message, actual: %s, expected: %s", resp.Error.Id, errorId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckStartsWith(t *testing.T, value, prefix, message string) {
|
func CheckStartsWith(t *testing.T, value, prefix, message string) {
|
||||||
|
|||||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Ссылка в новой задаче
Block a user