Skip to content

Commit

Permalink
Add skip logic when initial dataset is not given (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytswd authored May 5, 2022
1 parent a7ee088 commit 44b9d4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func PrepTable(t testing.TB, client *dynamodb.Client, input ...InitialTableSetup
t.Fatalf("Could not create table '%s': %v", *i.Table.TableName, err)
}

if len(i.InitialData) == 0 {
t.Logf("Table '%s' has been created, and no initial data has been added", *i.Table.TableName)
continue
}

puts := []types.WriteRequest{}
for _, d := range i.InitialData {
puts = append(puts, types.WriteRequest{PutRequest: d})
Expand Down

0 comments on commit 44b9d4e

Please sign in to comment.