Created
February 28, 2023 03:37
-
-
Save niski84/4c11df77247495e1a5ef8cbf0e5d3846 to your computer and use it in GitHub Desktop.
test cases for EB pause and resume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package awsapi | |
import ( | |
"testing" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
) | |
func TestPauseEnvironment(t *testing.T) { | |
// Create a new AWS session | |
sess := session.Must(session.NewSession(&aws.Config{ | |
Region: aws.String("us-west-2"), | |
})) | |
// Create an instance of the struct | |
instance := Instance{AwsSession: sess} | |
// Test the PauseEnvironment function | |
err := PauseEnvironment(instance, "my-environment") | |
if err != nil { | |
t.Errorf("failed to pause environment: %v", err) | |
} | |
} | |
func TestResumeEnvironment(t *testing.T) { | |
// Create a new AWS session | |
sess := session.Must(session.NewSession(&aws.Config{ | |
Region: aws.String("us-west-2"), | |
})) | |
// Create an instance of the struct | |
instance := Instance{AwsSession: sess} | |
// Test the ResumeEnvironment function | |
err := ResumeEnvironment(instance, "my-environment") | |
if err != nil { | |
t.Errorf("failed to resume environment: %v", err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment