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

Function TestLoadOAuthCredentialsFromEnvKeepsAppKeyFallbacks

cmd/root_test.go:763–785  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

761}
762
763func TestLoadOAuthCredentialsFromEnvKeepsAppKeyFallbacks(t *testing.T) {
764 restoreOAuthCredentials(t)
765
766 for _, key := range []string{
767 "DROPBOX_PERSONAL_APP_KEY",
768 "DROPBOX_TEAM_APP_KEY",
769 "DROPBOX_MANAGE_APP_KEY",
770 } {
771 unsetEnvForTest(t, key)
772 }
773
774 teamAccessAppKey = "team-access-key"
775 teamManageAppKey = "team-manage-key"
776
777 loadOAuthCredentialsFromEnv()
778
779 if teamManageAppKey != "team-manage-key" {
780 t.Fatalf("expected team manage app key fallback, got %q", teamManageAppKey)
781 }
782 if teamAccessAppKey != "team-access-key" {
783 t.Fatalf("expected team access app key fallback, got %q", teamAccessAppKey)
784 }
785}

Callers

nothing calls this directly

Calls 3

restoreOAuthCredentialsFunction · 0.85
unsetEnvForTestFunction · 0.85

Tested by

no test coverage detected