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