(t *testing.T)
| 346 | } |
| 347 | |
| 348 | func TestLoginAddsHostIfNotAlreadyAdded(t *testing.T) { |
| 349 | // Given we are logged in |
| 350 | authCfg := newTestAuthConfig(t) |
| 351 | _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false) |
| 352 | require.NoError(t, err) |
| 353 | |
| 354 | // When we get the hosts |
| 355 | hosts := authCfg.Hosts() |
| 356 | |
| 357 | // Then it includes our logged in host |
| 358 | require.Contains(t, hosts, "github.com") |
| 359 | } |
| 360 | |
| 361 | // This test mimics the behaviour of logging in with a token, not providing |
| 362 | // a git protocol, and using secure storage. |
nothing calls this directly
no test coverage detected