MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestLoginAppKeyFlagSetsKey

Function TestLoginAppKeyFlagSetsKey

cmd/login_test.go:194–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestLoginAppKeyFlagSetsKey(t *testing.T) {
195 restoreOAuthCredentials(t)
196 setOAuthCredentials(tokenPersonal, defaultPersonalAppKey)
197
198 cmd := newLoginTestCommand()
199 if err := cmd.Flags().Set("app-key", "flag-key"); err != nil {
200 t.Fatal(err)
201 }
202
203 if err := loginAppKeyFromFlag(cmd, tokenPersonal); err != nil {
204 t.Fatal(err)
205 }
206 appKey := oauthCredentials(tokenPersonal)
207 if appKey != "flag-key" {
208 t.Fatalf("expected app key from flag, got %q", appKey)
209 }
210}
211
212func TestLoginAndLogoutSkipRootAuthPreRun(t *testing.T) {
213 if loginCmd.PersistentPreRunE == nil {

Callers

nothing calls this directly

Calls 5

restoreOAuthCredentialsFunction · 0.85
setOAuthCredentialsFunction · 0.85
newLoginTestCommandFunction · 0.85
loginAppKeyFromFlagFunction · 0.85
oauthCredentialsFunction · 0.85

Tested by

no test coverage detected