(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestTokenStoredInKeyring(t *testing.T) { |
| 110 | // When the user has logged in securely |
| 111 | authCfg := newTestAuthConfig(t) |
| 112 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", true) |
| 113 | require.NoError(t, err) |
| 114 | |
| 115 | // When we get the token |
| 116 | token, source := authCfg.ActiveToken("github.com") |
| 117 | |
| 118 | // Then the token is successfully fetched |
| 119 | // and the source is set to keyring |
| 120 | require.Equal(t, "test-token", token) |
| 121 | require.Equal(t, "keyring", source) |
| 122 | } |
| 123 | |
| 124 | func TestTokenFromKeyringNonExistent(t *testing.T) { |
| 125 | // Given a keyring that doesn't contain any tokens |
nothing calls this directly
no test coverage detected