MCPcopy Create free account
hub / github.com/cli/cli / SetActiveToken

Method SetActiveToken

internal/gh/gh.go:197–197  ·  view source on GitHub ↗

The following methods are only for testing and that is a design smell we should consider fixing. SetActiveToken will override any token resolution and return the given token and source for all calls to ActiveToken. Use for testing purposes only.

(token, source string)

Source from the content-addressed store, hash-verified

195 // ActiveToken.
196 // Use for testing purposes only.
197 SetActiveToken(token, source string)
198
199 // SetHosts will override any hosts resolution and return the given hosts for all calls to Hosts.
200 // Use for testing purposes only.

Callers 8

Test_BaseRepoFunction · 0.95
Test_SmartBaseRepoFunction · 0.95
Test_remoteResolverFunction · 0.95
Test_apiRun_cacheFunction · 0.95
Test_authRecoveryCommandFunction · 0.65
TestActiveTokenTypeFunction · 0.65

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls

Tested by 8

Test_BaseRepoFunction · 0.76
Test_SmartBaseRepoFunction · 0.76
Test_remoteResolverFunction · 0.76
Test_apiRun_cacheFunction · 0.76
Test_authRecoveryCommandFunction · 0.52
TestActiveTokenTypeFunction · 0.52