(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestReadToken(t *testing.T) { |
| 90 | viper.Set("token.path", "./test-fixtures/test_token.json") |
| 91 | tok, err := ReadToken() |
| 92 | assert.NoError(t, err) |
| 93 | assert.NotNil(t, tok) |
| 94 | assert.Equal(t, "test_access_token", tok.AccessToken) |
| 95 | assert.Equal(t, "test_refresh_token", tok.RefreshToken) |
| 96 | assert.Equal(t, "2019-11-09 14:01:07.170612451 +0000 UTC", tok.Expiry.String()) |
| 97 | assert.Equal(t, "Bearer", tok.TokenType) |
| 98 | } |
| 99 | |
| 100 | func TestReadTokenFileError(t *testing.T) { |
| 101 | viper.Set("token.path", "./test-fixtures/not_a_real_path.json") |
nothing calls this directly
no test coverage detected