Skip to content

Commit ea0f9ba

Browse files
[livestream] api tests: use oapi mode constants and fix err shadowing
1 parent cd32e3d commit ea0f9ba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/cmd/api/api/api_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestApiService_StartRecording(t *testing.T) {
5656
mgr := recorder.NewFFmpegManager()
5757
svc := newApiServiceForTest(t, mgr)
5858

59+
var err error
5960
for i := 0; i < 5; i++ {
6061
customID := fmt.Sprintf("rec-%d", i)
6162
resp, err := svc.StartRecording(ctx, oapi.StartRecordingRequestObject{Body: &oapi.StartRecordingJSONRequestBody{Id: &customID}})
@@ -191,7 +192,7 @@ func TestApiService_StreamLifecycle(t *testing.T) {
191192
mgr := recorder.NewFFmpegManager()
192193
svc := newApiServiceForTest(t, mgr)
193194

194-
mode := "internal"
195+
mode := oapi.StartStreamRequestModeInternal
195196
resp, err := svc.StartStream(ctx, oapi.StartStreamRequestObject{
196197
Body: &oapi.StartStreamJSONRequestBody{Mode: &mode},
197198
})
@@ -222,7 +223,7 @@ func TestApiService_StartStream_RemoteValidation(t *testing.T) {
222223
mgr := recorder.NewFFmpegManager()
223224
svc := newApiServiceForTest(t, mgr)
224225

225-
mode := "remote"
226+
mode := oapi.StartStreamRequestModeRemote
226227
resp, err := svc.StartStream(ctx, oapi.StartStreamRequestObject{
227228
Body: &oapi.StartStreamJSONRequestBody{Mode: &mode},
228229
})

0 commit comments

Comments
 (0)