(t *testing.T)
| 192 | } |
| 193 | |
| 194 | func 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 | |
| 212 | func TestLoginAndLogoutSkipRootAuthPreRun(t *testing.T) { |
| 213 | if loginCmd.PersistentPreRunE == nil { |
nothing calls this directly
no test coverage detected