sqs-browse: started working on tests for controllers
This commit is contained in:
parent
fb749aaee2
commit
43680000a8
14 changed files with 305 additions and 39 deletions
|
|
@ -54,6 +54,7 @@ func (s *Service) Scan(ctx context.Context, table string) (*models.ResultSet, er
|
|||
models.Sort(results, pk, sk)
|
||||
|
||||
return &models.ResultSet{
|
||||
Table: table,
|
||||
Columns: columns,
|
||||
Items: results,
|
||||
}, nil
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ func TestService_Scan(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Hash first, then range, then columns in alphabetic order
|
||||
assert.Equal(t, rs.Table, tableName)
|
||||
assert.Equal(t, rs.Columns, []string{"pk", "sk", "alpha", "beta", "gamma"})
|
||||
assert.Equal(t, rs.Items[0], testdynamo.TestRecordAsItem(t, testData[1]))
|
||||
assert.Equal(t, rs.Items[1], testdynamo.TestRecordAsItem(t, testData[0]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue