From d1ece9045c2cf330cfef029d6df811c392571c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Einarson?= Date: Fri, 26 Jan 2024 13:17:19 +0100 Subject: [PATCH] test: add test that too early media segment response is 425 --- cmd/livesim2/app/handler_livesim_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/livesim2/app/handler_livesim_test.go b/cmd/livesim2/app/handler_livesim_test.go index b040d62..bac9821 100644 --- a/cmd/livesim2/app/handler_livesim_test.go +++ b/cmd/livesim2/app/handler_livesim_test.go @@ -161,6 +161,20 @@ func TestFetches(t *testing.T) { wantedStatusCode: http.StatusOK, wantedContentType: `video/mp4`, }, + { + desc: "thumbnail image too early", + url: "testpic_2s_thumbs/thumbs/300.jpg?nowMS=510000", + params: "", + wantedStatusCode: 425, + wantedContentType: `image/jpeg`, + }, + { + desc: "media segment too early", + url: "testpic_2s/V300/300.m4s?nowMS=510000", + params: "", + wantedStatusCode: 425, + wantedContentType: `video/mp4`, + }, } for _, tc := range testCases {