MCPcopy Create free account
hub / github.com/dinofizz/diskplayer / TestRealDiskplayerServer_RunCallbackServer

Function TestRealDiskplayerServer_RunCallbackServer

server_test.go:24–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestRealDiskplayerServer_RunCallbackServer(t *testing.T) {
25 viper.Set("spotify.callback_url", "http://localhost:8732/callback")
26 a := &spotify.Authenticator{}
27 ch := make(chan *oauth2.Token, 1)
28 ds := NewDiskplayerServer(a, ch)
29 viper.Set("recorder.server_port", 4389)
30 s, err := ds.RunCallbackServer()
31 assert.NoError(t,err)
32 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
33 defer cancel()
34 err = s.Shutdown(ctx)
35 assert.NoError(t,err)
36}
37
38func TestErrorHandler(t *testing.T) {
39 rr := httptest.NewRecorder()

Callers

nothing calls this directly

Calls 2

RunCallbackServerMethod · 0.95
NewDiskplayerServerFunction · 0.85

Tested by

no test coverage detected