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

Function TestBuildAuthURL

cmd/login_test.go:136–145  ·  view source on GitHub ↗

TestBuildAuthURL verifies that the buildAuthURL function correctly constructs OAuth authentication URLs with proper state and return URI parameters.

(t *testing.T)

Source from the content-addressed store, hash-verified

134// TestBuildAuthURL verifies that the buildAuthURL function correctly constructs
135// OAuth authentication URLs with proper state and return URI parameters.
136func TestBuildAuthURL(t *testing.T) {
137 state := "test_state_123"
138 returnURI := "http://127.0.0.1:8080/callback"
139
140 url := buildAuthURL(state, returnURI)
141
142 assert.Contains(t, url, "https://console.thundercompute.com/login/app")
143 assert.Contains(t, url, "state=test_state_123")
144 assert.Contains(t, url, "return_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fcallback")
145}
146
147// TestOpenBrowser verifies that the openBrowser function doesn't panic when
148// called with a valid URL, even if the actual browser opening fails.

Callers

nothing calls this directly

Calls 1

buildAuthURLFunction · 0.85

Tested by

no test coverage detected