Skip to content

Commit

Permalink
test(provider): unset envvars during credential testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-github committed Jul 3, 2024
1 parent 19e8334 commit f956a13
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ var testAccProviderFactories = map[string]func() (tfprotov6.ProviderServer, erro
}

func TestProviderConfigure_invalidCredentials(t *testing.T) {
location := os.Getenv("CLOUDSIGMA_LOCATION")
_ = os.Unsetenv("CLOUDSIGMA_LOCATION")
defer func() { _ = os.Setenv("CLOUDSIGMA_LOCATION", location) }()

password := os.Getenv("CLOUDSIGMA_PASSWORD")
_ = os.Unsetenv("CLOUDSIGMA_PASSWORD")
defer func() { _ = os.Setenv("CLOUDSIGMA_PASSWORD", password) }()

token := os.Getenv("CLOUDSIGMA_TOKEN")
_ = os.Unsetenv("CLOUDSIGMA_TOKEN")
defer func() { _ = os.Setenv("CLOUDSIGMA_TOKEN", token) }()

username := os.Getenv("CLOUDSIGMA_USERNAME")
_ = os.Unsetenv("CLOUDSIGMA_USERNAME")
defer func() { _ = os.Setenv("CLOUDSIGMA_USERNAME", username) }()

resource.UnitTest(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProviderFactories,

Expand Down

0 comments on commit f956a13

Please sign in to comment.