Include a shared Last.FM api key, providing zero conf ArtistInfo (bio/top songs/similar artists)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package agents
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/navidrome/navidrome/conf"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("lastfmAgent", func() {
|
||||
Describe("lastFMConstructor", func() {
|
||||
It("uses default api key and language if not configured", func() {
|
||||
conf.Server.LastFM.ApiKey = ""
|
||||
agent := lastFMConstructor(context.TODO())
|
||||
Expect(agent.(*lastfmAgent).apiKey).To(Equal(lastFMAPIKey))
|
||||
Expect(agent.(*lastfmAgent).lang).To(Equal("en"))
|
||||
})
|
||||
|
||||
It("uses configured api key and language", func() {
|
||||
conf.Server.LastFM.ApiKey = "123"
|
||||
conf.Server.LastFM.Language = "pt"
|
||||
agent := lastFMConstructor(context.TODO())
|
||||
Expect(agent.(*lastfmAgent).apiKey).To(Equal("123"))
|
||||
Expect(agent.(*lastfmAgent).lang).To(Equal("pt"))
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user