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