dynamotestutils

package
v1.5.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAfter

func AssertAfter(t *testing.T, db *dynamodb.DynamoDB, table string, expected []map[string]*dynamodb.AttributeValue) bool

func NewClientV1 added in v1.5.18

func NewClientV1(t *testing.T) (*sessionv1.Session, *dynamodbv1.DynamoDB, string)

NewClientV1 generate AWS session, DynamoDB client, and a table name that will be deleted at the end of the function.

func NewLocalstackSession

func NewLocalstackSession() *sessionv1.Session

func NewTestTableName

func NewTestTableName(t *testing.T) string

func SetContent

func SetContent(t *testing.T, db *dynamodb.DynamoDB, table string, entries []map[string]*dynamodb.AttributeValue)

Types

type DynamodbTestContext added in v1.5.19

type DynamodbTestContext struct {
	T      *testing.T
	Ctx    context.Context
	Cfg    aws.Config
	Client *dynamodb.Client
	Table  string
}

func NewTestContext added in v1.5.19

func NewTestContext(ctx context.Context, t *testing.T) *DynamodbTestContext

func (*DynamodbTestContext) EqualContent added in v1.5.19

func (d *DynamodbTestContext) EqualContent(ctx context.Context, wantItems []map[string]types.AttributeValue) (bool, error)

func (*DynamodbTestContext) Got added in v1.5.19

func (*DynamodbTestContext) Must added in v1.5.19

func (d *DynamodbTestContext) Must(err error)

func (*DynamodbTestContext) MustBool added in v1.5.19

func (d *DynamodbTestContext) MustBool(value bool, err error) bool

func (*DynamodbTestContext) Subtest added in v1.5.19

func (*DynamodbTestContext) WithDbContent added in v1.5.19

func (d *DynamodbTestContext) WithDbContent(ctx context.Context, entries []map[string]types.AttributeValue) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL