Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Jul 31, 2024
1 parent 5133b5d commit 7225eda
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions internal/validators/aws_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package validators

import (
"github.com/mcasperson/OctoterraWizard/internal/state"
"os"
"testing"
)

func TestAWSCredsExists(t *testing.T) {
accessKey := os.Getenv("AWS_ACCESS_KEY_ID")
secretKey := os.Getenv("AWS_SECRET_ACCESS_KEY")

testState := state.State{
BackendType: "",
Server: "",
ServerExternal: "",
ApiKey: "",
Space: "",
DestinationServer: "",
DestinationServerExternal: "",
DestinationApiKey: "",
DestinationSpace: "",
AwsAccessKey: accessKey,
AwsSecretKey: secretKey,
AwsS3Bucket: "",
AwsS3BucketRegion: "",
PromptForDelete: false,
UseContainerImages: false,
AzureResourceGroupName: "",
AzureStorageAccountName: "",
AzureContainerName: "",
AzureSubscriptionId: "",
AzureTenantId: "",
AzureApplicationId: "",
AzurePassword: "",
}

err := ValidateAWS(testState)
if err != nil {
t.Fatalf("Error checking aws creds: %v", err)
}
}

0 comments on commit 7225eda

Please sign in to comment.