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