(t *testing.T)
| 236 | } |
| 237 | |
| 238 | func TestDefaultHostLoggedInToOnlyOneHost(t *testing.T) { |
| 239 | // Given we are logged into one host (not github.com to differentiate from the fallback) |
| 240 | authCfg := newTestAuthConfig(t) |
| 241 | _, err := authCfg.Login("ghe.io", "test-user", "test-token", "", false) |
| 242 | require.NoError(t, err) |
| 243 | |
| 244 | // When we get the DefaultHost |
| 245 | defaultHost, source := authCfg.DefaultHost() |
| 246 | |
| 247 | // Then the returned host is that logged in host and the source is the hosts config |
| 248 | require.Equal(t, "ghe.io", defaultHost) |
| 249 | require.Equal(t, hostsKey, source) |
| 250 | } |
| 251 | |
| 252 | func TestLoginSecureStorageUsesKeyring(t *testing.T) { |
| 253 | // Given a usable keyring |
nothing calls this directly
no test coverage detected