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

Function unsetEnvForTest

cmd/root_test.go:747–761  ·  view source on GitHub ↗
(t *testing.T, key string)

Source from the content-addressed store, hash-verified

745}
746
747func unsetEnvForTest(t *testing.T, key string) {
748 t.Helper()
749
750 old, exists := os.LookupEnv(key)
751 if err := os.Unsetenv(key); err != nil {
752 t.Fatal(err)
753 }
754 t.Cleanup(func() {
755 if exists {
756 _ = os.Setenv(key, old)
757 } else {
758 _ = os.Unsetenv(key)
759 }
760 })
761}
762
763func TestLoadOAuthCredentialsFromEnvKeepsAppKeyFallbacks(t *testing.T) {
764 restoreOAuthCredentials(t)

Calls

no outgoing calls

Tested by

no test coverage detected