MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestGenerateState

Function TestGenerateState

cmd/login_test.go:123–132  ·  view source on GitHub ↗

TestGenerateState verifies that the generateState function creates unique, properly formatted state strings for OAuth authentication.

(t *testing.T)

Source from the content-addressed store, hash-verified

121// TestGenerateState verifies that the generateState function creates unique,
122// properly formatted state strings for OAuth authentication.
123func TestGenerateState(t *testing.T) {
124 state1, err := generateState()
125 require.NoError(t, err)
126 assert.NotEmpty(t, state1)
127 assert.Len(t, state1, 44)
128
129 state2, err := generateState()
130 require.NoError(t, err)
131 assert.NotEqual(t, state1, state2)
132}
133
134// TestBuildAuthURL verifies that the buildAuthURL function correctly constructs
135// OAuth authentication URLs with proper state and return URI parameters.

Callers

nothing calls this directly

Calls 1

generateStateFunction · 0.85

Tested by

no test coverage detected