From ebb97fb7367fb983cffc1935a8fb57e4b80f5249 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 25 Jan 2024 20:11:31 -0500 Subject: Move funcs package to internal (#1977) Signed-off-by: Dave Henderson --- funcs/aws_test.go | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 funcs/aws_test.go (limited to 'funcs/aws_test.go') diff --git a/funcs/aws_test.go b/funcs/aws_test.go deleted file mode 100644 index 2a1efc5d..00000000 --- a/funcs/aws_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package funcs - -import ( - "context" - "strconv" - "testing" - - "github.com/hairyhenderson/gomplate/v4/aws" - "github.com/stretchr/testify/assert" -) - -func TestCreateAWSFuncs(t *testing.T) { - t.Parallel() - - for i := 0; i < 10; i++ { - // Run this a bunch to catch race conditions - t.Run(strconv.Itoa(i), func(t *testing.T) { - t.Parallel() - - ctx := context.Background() - fmap := CreateAWSFuncs(ctx) - actual := fmap["aws"].(func() interface{}) - - assert.Equal(t, ctx, actual().(*Funcs).ctx) - }) - } -} - -func TestAWSFuncs(t *testing.T) { - t.Parallel() - - m := aws.NewDummyEc2Meta() - i := aws.NewDummyEc2Info(m) - af := &Funcs{meta: m, info: i} - assert.Equal(t, "unknown", must(af.EC2Region())) - assert.Equal(t, "", must(af.EC2Meta("foo"))) - assert.Equal(t, "", must(af.EC2Tag("foo"))) - assert.Equal(t, "unknown", must(af.EC2Region())) -} - -func must(r interface{}, err error) interface{} { - if err != nil { - panic(err) - } - return r -} -- cgit v1.2.3