mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
server: fix tests
This commit is contained in:
@@ -1018,10 +1018,13 @@ func TestServerErrorInvalidPath(t *testing.T) {
|
|||||||
// base.SetParameter,
|
// base.SetParameter,
|
||||||
} {
|
} {
|
||||||
t.Run(string(method), func(t *testing.T) {
|
t.Run(string(method), func(t *testing.T) {
|
||||||
|
connClosed := make(chan struct{})
|
||||||
|
|
||||||
s := &Server{
|
s := &Server{
|
||||||
Handler: &testServerHandler{
|
Handler: &testServerHandler{
|
||||||
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
|
onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) {
|
||||||
require.Equal(t, "invalid path", ctx.Error.Error())
|
require.Equal(t, "invalid path", ctx.Error.Error())
|
||||||
|
close(connClosed)
|
||||||
},
|
},
|
||||||
onAnnounce: func(ctx *ServerHandlerOnAnnounceCtx) (*base.Response, error) {
|
onAnnounce: func(ctx *ServerHandlerOnAnnounceCtx) (*base.Response, error) {
|
||||||
return &base.Response{
|
return &base.Response{
|
||||||
@@ -1131,6 +1134,8 @@ func TestServerErrorInvalidPath(t *testing.T) {
|
|||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, base.StatusBadRequest, res.StatusCode)
|
require.Equal(t, base.StatusBadRequest, res.StatusCode)
|
||||||
|
|
||||||
|
<-connClosed
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user