add unit tests for ListenBrainz scrobbler (#317)

* Access HTTP client via interface to allow for testing

* [Minor] Fix typo

* Add initial test cases for ListenBrainz scrobbler

* Fix linter error for insecure TLS in tests

* Use Testify for unit tests

* Move model into separate file

* Embed JSON responses into tests

* [Minor] Fix test function names
This commit is contained in:
Gregor Zurowski
2023-05-13 14:10:11 +02:00
committed by GitHub
parent 05b2b469dc
commit bb8507a72f
7 changed files with 212 additions and 26 deletions

View File

@@ -107,7 +107,7 @@ func New(opts Options) (*Server, error) {
PodcastsPath: opts.PodcastPath,
CacheAudioPath: opts.CacheAudioPath,
CoverCachePath: opts.CoverCachePath,
Scrobblers: []scrobble.Scrobbler{&lastfm.Scrobbler{DB: opts.DB}, &listenbrainz.Scrobbler{}},
Scrobblers: []scrobble.Scrobbler{&lastfm.Scrobbler{DB: opts.DB}, listenbrainz.NewScrobbler()},
Podcasts: podcast,
Transcoder: cacheTranscoder,
}