Skip to content

Commit

Permalink
tests: remove EC2Client from app_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsmitt committed Oct 11, 2024
1 parent f2233d4 commit 7f6d222
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions internal/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ecs"
ecsTypes "github.com/aws/aws-sdk-go-v2/service/ecs/types"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -54,18 +53,6 @@ func (m ECSClientMock) ExecuteCommand(ctx context.Context, params *ecs.ExecuteCo
return m.ExecuteCommandMock(ctx, params, optFns...)
}

type MockEC2API struct {
ec2.Client // embedding of the interface is needed to skip implementation of all methods
DescribeInstancesMock func(input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
}

func (m *MockEC2API) DescribeInstances(input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) {
if m.DescribeInstancesMock != nil {
return m.DescribeInstancesMock(input)
}
return nil, nil
}

// CreateMockApp initialises a new App struct and takes a MockClient as an argument - only used in tests
func CreateMockApp(c ECSClient) *App {
e := &App{
Expand Down

0 comments on commit 7f6d222

Please sign in to comment.