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

Method SetActiveToken

internal/gh/gh.go:205–205  ·  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

203 // ActiveToken.
204 // Use for testing purposes only.
205 SetActiveToken(token, source string)
206
207 // SetHosts will override any hosts resolution and return the given hosts for all calls to Hosts.
208 // 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