(t *testing.T)
| 301 | } |
| 302 | |
| 303 | func TestLoginInsecureStorage(t *testing.T) { |
| 304 | // Given we are not logged in |
| 305 | authCfg := newTestAuthConfig(t) |
| 306 | |
| 307 | // When we login with insecure storage |
| 308 | insecureStorageUsed, err := authCfg.Login("github.com", "test-user", "test-token", "", false) |
| 309 | |
| 310 | // Then it returns success, notes that insecure storage was used, and stores the token in the config |
| 311 | require.NoError(t, err) |
| 312 | |
| 313 | require.True(t, insecureStorageUsed, "expected to use insecure storage") |
| 314 | requireKeyWithValue(t, authCfg.cfg, []string{hostsKey, "github.com", oauthTokenKey}, "test-token") |
| 315 | } |
| 316 | |
| 317 | func TestLoginSetsUserForProvidedHost(t *testing.T) { |
| 318 | // Given we are not logged in |
nothing calls this directly
no test coverage detected