use require.EqualError() in tests

This commit is contained in:
aler9
2021-11-03 17:52:45 +01:00
parent e3d13be611
commit 78bfa5d6a8
25 changed files with 43 additions and 43 deletions

View File

@@ -603,7 +603,7 @@ func TestServerErrorCSeqMissing(t *testing.T) {
h := &testServerHandler{
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
require.Equal(t, "CSeq is missing", ctx.Error.Error())
require.EqualError(t, ctx.Error, "CSeq is missing")
close(connClosed)
},
}
@@ -635,7 +635,7 @@ func TestServerErrorInvalidMethod(t *testing.T) {
h := &testServerHandler{
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
require.Equal(t, "unhandled request (INVALID rtsp://localhost:8554/)", ctx.Error.Error())
require.EqualError(t, ctx.Error, "unhandled request (INVALID rtsp://localhost:8554/)")
close(connClosed)
},
}
@@ -1101,7 +1101,7 @@ func TestServerErrorInvalidPath(t *testing.T) {
s := &Server{
Handler: &testServerHandler{
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
require.Equal(t, "invalid path", ctx.Error.Error())
require.EqualError(t, ctx.Error, "invalid path")
close(connClosed)
},
onAnnounce: func(ctx *ServerHandlerOnAnnounceCtx) (*base.Response, error) {