MCPcopy Create free account
hub / github.com/52funny/pikpakcli / TestRemoteVideoOpenURL

Function TestRemoteVideoOpenURL

internal/shell/shell_test.go:684–726  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

682}
683
684func TestRemoteVideoOpenURL(t *testing.T) {
685 file := &api.File{}
686 file.Medias = []struct {
687 MediaID string `json:"media_id"`
688 MediaName string `json:"media_name"`
689 Video interface{} `json:"video"`
690 Link struct {
691 URL string `json:"url"`
692 Token string `json:"token"`
693 Expire time.Time `json:"expire"`
694 } `json:"link"`
695 NeedMoreQuota bool `json:"need_more_quota"`
696 VipTypes []interface{} `json:"vip_types"`
697 RedirectLink string `json:"redirect_link"`
698 IconLink string `json:"icon_link"`
699 IsDefault bool `json:"is_default"`
700 Priority int `json:"priority"`
701 IsOrigin bool `json:"is_origin"`
702 ResolutionName string `json:"resolution_name"`
703 IsVisible bool `json:"is_visible"`
704 Category string `json:"category"`
705 }{
706 {
707 Link: struct {
708 URL string `json:"url"`
709 Token string `json:"token"`
710 Expire time.Time `json:"expire"`
711 }{URL: "https://example.com/visible.m3u8"},
712 IsVisible: true,
713 },
714 {
715 Link: struct {
716 URL string `json:"url"`
717 Token string `json:"token"`
718 Expire time.Time `json:"expire"`
719 }{URL: "https://example.com/default.m3u8"},
720 IsDefault: true,
721 IsVisible: true,
722 },
723 }
724
725 require.Equal(t, "https://example.com/default.m3u8", remoteVideoOpenURL(file))
726}
727
728func TestResolveOpenTargetForVideoPrefersRemoteURL(t *testing.T) {
729 file := &api.File{}

Callers

nothing calls this directly

Calls 1

remoteVideoOpenURLFunction · 0.85

Tested by

no test coverage detected