(t *testing.T)
| 330 | } |
| 331 | |
| 332 | func TestLoginAddsHostIfNotAlreadyAdded(t *testing.T) { |
| 333 | // Given we are logged in |
| 334 | authCfg := newTestAuthConfig(t) |
| 335 | _, err := authCfg.Login("github.com", "test-user", "test-token", "ssh", false) |
| 336 | require.NoError(t, err) |
| 337 | |
| 338 | // When we get the hosts |
| 339 | hosts := authCfg.Hosts() |
| 340 | |
| 341 | // Then it includes our logged in host |
| 342 | require.Contains(t, hosts, "github.com") |
| 343 | } |
| 344 | |
| 345 | // This test mimics the behaviour of logging in with a token, not providing |
| 346 | // a git protocol, and using secure storage. |
nothing calls this directly
no test coverage detected