MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestAuthManager_ClearToken

Function TestAuthManager_ClearToken

pkg/api/auth_test.go:373–389  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

371}
372
373func TestAuthManager_ClearToken(t *testing.T) {
374 httpClient := &HTTPClient{baseURL: "https://test.example.com"}
375 logger := testutils.NewTestLogger()
376
377 authManager := NewAuthManagerWithPassword(httpClient, "user", "pass", logger)
378
379 // Set a token
380 authManager.authToken = &AuthToken{
381 Ticket: "test-ticket",
382 ExpiresAt: time.Now().Add(1 * time.Hour),
383 }
384
385 // Clear the token
386 authManager.ClearToken()
387
388 assert.Nil(t, authManager.authToken)
389}
390
391func TestAuthManager_ConcurrentAccess(t *testing.T) {
392 // Create a test server that simulates slow authentication

Callers

nothing calls this directly

Calls 3

NewTestLoggerFunction · 0.92
ClearTokenMethod · 0.80

Tested by

no test coverage detected