(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestTokenStoredInConfig(t *testing.T) { |
| 81 | // Given the user has logged in insecurely |
| 82 | authCfg := newTestAuthConfig(t) |
| 83 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", false) |
| 84 | require.NoError(t, err) |
| 85 | |
| 86 | // When we get the token |
| 87 | token, source := authCfg.ActiveToken("github.com") |
| 88 | |
| 89 | // Then the token is successfully fetched |
| 90 | // and the source is set to oauth_token but this isn't great: |
| 91 | // https://github.com/cli/go-gh/issues/94 |
| 92 | require.Equal(t, "test-token", token) |
| 93 | require.Equal(t, oauthTokenKey, source) |
| 94 | } |
| 95 | |
| 96 | func TestTokenStoredInEnv(t *testing.T) { |
| 97 | // When the user is authenticated via env var |
nothing calls this directly
no test coverage detected