mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-18 19:19:28 +02:00
Extended Spotify test
This commit is contained in:
parent
1a06168039
commit
d55114ed3f
1 changed files with 9 additions and 0 deletions
|
@ -23,11 +23,20 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/spf13/viper"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uploadedlobster.com/scotty/backends/spotify"
|
"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) {
|
func TestSpotifyListenAsListen(t *testing.T) {
|
||||||
data, err := os.ReadFile("testdata/listen.json")
|
data, err := os.ReadFile("testdata/listen.json")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue