(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestNewTokenCallbackServerError(t *testing.T) { |
| 73 | viper.Set("spotify.callback_url", "http://localhost:8732/callback") |
| 74 | viper.Set("spotify.client_id", "client_id") |
| 75 | viper.Set("spotify.client_secret", "client_secret") |
| 76 | |
| 77 | ms := new(mocks.DiskplayerServer) |
| 78 | |
| 79 | a, err := NewAuthenticator() |
| 80 | assert.NoError(t, err) |
| 81 | |
| 82 | ms.On("Authenticator").Return(a, nil) |
| 83 | ms.On("RunCallbackServer").Return(nil, errors.New("RunCallbackServer error")) |
| 84 | tok, err := NewToken(ms) |
| 85 | assert.Nil(t, tok) |
| 86 | assert.EqualError(t, err, "RunCallbackServer error") |
| 87 | } |
| 88 | |
| 89 | func TestReadToken(t *testing.T) { |
| 90 | viper.Set("token.path", "./test-fixtures/test_token.json") |
nothing calls this directly
no test coverage detected