(t *testing.T)
| 222 | } |
| 223 | |
| 224 | func TestDefaultHostLoggedInToOnlyOneHost(t *testing.T) { |
| 225 | // Given we are logged into one host (not github.com to differentiate from the fallback) |
| 226 | authCfg := newTestAuthConfig(t) |
| 227 | _, err := authCfg.Login("ghe.io", "test-user", "test-token", "", false) |
| 228 | require.NoError(t, err) |
| 229 | |
| 230 | // When we get the DefaultHost |
| 231 | defaultHost, source := authCfg.DefaultHost() |
| 232 | |
| 233 | // Then the returned host is that logged in host and the source is the hosts config |
| 234 | require.Equal(t, "ghe.io", defaultHost) |
| 235 | require.Equal(t, hostsKey, source) |
| 236 | } |
| 237 | |
| 238 | func TestLoginSecureStorageUsesKeyring(t *testing.T) { |
| 239 | // Given a usable keyring |
nothing calls this directly
no test coverage detected