Extended Spotify test

This commit is contained in:
Philipp Wolfer 2023-11-23 17:34:36 +01:00
parent 1a06168039
commit d55114ed3f
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B

View file

@ -23,11 +23,20 @@ import (
"testing"
"time"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uploadedlobster.com/scotty/backends/spotify"
)
func TestFromConfig(t *testing.T) {
config := viper.New()
config.Set("client-id", "someclientid")
config.Set("client-secret", "someclientsecret")
backend := (&spotify.SpotifyApiBackend{}).FromConfig(config)
assert.IsType(t, &spotify.SpotifyApiBackend{}, backend)
}
func TestSpotifyListenAsListen(t *testing.T) {
data, err := os.ReadFile("testdata/listen.json")
require.NoError(t, err)