Sync shared snapshot from 9e58b6d
This commit is contained in:
1 parent
36ab01aab1
commit
5a4bf45bc7
10 files changed
+393
-51
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -124,3 +125,20 @@ func TestOnlyModeratorsCanSeeHiddenMedia(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestStreamUpstreamPathForwardsOnlyLiveTranscodeOptions(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
query url.Values
|
||||
want string
|
||||
}{
|
||||
{"plain stream", url.Values{"mediaKey": {"abc"}}, "/media/Videos/clip.mp4"},
|
||||
{"blank options are dropped", url.Values{"quality": {" "}, "start": {""}}, "/media/Videos/clip.mp4"},
|
||||
{"quality and start are forwarded", url.Values{"mediaKey": {"abc"}, "quality": {"1080"}, "start": {" 12.5 "}}, "/media/Videos/clip.mp4?quality=1080&start=12.5"},
|
||||
{"quality alone", url.Values{"quality": {"720"}}, "/media/Videos/clip.mp4?quality=720"},
|
||||
} {
|
||||
if got := streamUpstreamPath("Videos/clip.mp4", tc.query); got != tc.want {
|
||||
t.Errorf("%s: streamUpstreamPath() = %q, want %q", tc.name, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user