(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestHasActiveToken(t *testing.T) { |
| 56 | // Given the user has logged in for a host |
| 57 | authCfg := newTestAuthConfig(t) |
| 58 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", false) |
| 59 | require.NoError(t, err) |
| 60 | |
| 61 | // When we check if that host has an active token |
| 62 | hasActiveToken := authCfg.HasActiveToken("github.com") |
| 63 | |
| 64 | // Then there is an active token |
| 65 | require.True(t, hasActiveToken, "expected there to be an active token") |
| 66 | } |
| 67 | |
| 68 | func TestHasNoActiveToken(t *testing.T) { |
| 69 | // Given there are no users logged in for a host |
nothing calls this directly
no test coverage detected