small refactor*
This commit is contained in:
parent
b6b541e050
commit
24a4d30275
232 changed files with 2164 additions and 1906 deletions
server/pkg/ytdlp
27
server/pkg/ytdlp/playlist_test.go
Normal file
27
server/pkg/ytdlp/playlist_test.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package ytdlp_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/server/pkg/ytdlp"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPlaylist(t *testing.T) {
|
||||
require := require.New(t)
|
||||
ctx := context.Background()
|
||||
if deadline, ok := t.Deadline(); ok {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithDeadlineCause(ctx, deadline, errors.New("test deadline done"))
|
||||
defer cancel()
|
||||
}
|
||||
client, err := ytdlp.New()
|
||||
require.NoError(err)
|
||||
entries, err := client.Playlist(ctx, "https://www.youtube.com/playlist?list=PLUay9m6GhoyCXdloEa-VYtnVeshaKl4AW")
|
||||
require.NoError(err)
|
||||
|
||||
require.NotEmpty(entries)
|
||||
require.Len(entries, int(entries[0].PlaylistCount))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue