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

Function TestAuthManager_IsTokenAuth

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

Source from the content-addressed store, hash-verified

96}
97
98func TestAuthManager_IsTokenAuth(t *testing.T) {
99 httpClient := &HTTPClient{baseURL: "https://test.example.com"}
100 logger := testutils.NewTestLogger()
101
102 // Test password auth
103 passwordAuth := NewAuthManagerWithPassword(httpClient, "user", "pass", logger)
104 assert.False(t, passwordAuth.IsTokenAuth())
105
106 // Test token auth
107 tokenAuth := NewAuthManagerWithToken(httpClient, "token", logger)
108 assert.True(t, tokenAuth.IsTokenAuth())
109}
110
111func TestAuthManager_EnsureAuthenticated_WithToken(t *testing.T) {
112 // Create a mock HTTP client

Callers

nothing calls this directly

Calls 4

NewTestLoggerFunction · 0.92
NewAuthManagerWithTokenFunction · 0.85
IsTokenAuthMethod · 0.80

Tested by

no test coverage detected