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

Function TestReadToken

auth_test.go:89–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func 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
100func TestReadTokenFileError(t *testing.T) {
101 viper.Set("token.path", "./test-fixtures/not_a_real_path.json")

Callers

nothing calls this directly

Calls 1

ReadTokenFunction · 0.85

Tested by

no test coverage detected