-
-
Notifications
You must be signed in to change notification settings - Fork 178
/
updatetable_test.go
43 lines (38 loc) · 975 Bytes
/
updatetable_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package dynamo
import (
"context"
"testing"
)
// TODO: enable this test
func _TestUpdateTable(t *testing.T) {
if testDB == nil {
t.Skip(offlineSkipMsg)
}
table := testDB.Table(testTableWidgets)
ctx := context.TODO()
desc, err := table.UpdateTable().CreateIndex(Index{
Name: "test123",
HashKey: "Time",
HashKeyType: StringType,
RangeKey: "UserID",
RangeKeyType: NumberType,
ProjectionType: IncludeProjection,
ProjectionAttribs: []string{"Msg"},
Throughput: Throughput{
Read: 1,
Write: 1,
},
}).Run(ctx)
// desc, err := table.UpdateTable().DeleteIndex("test123").Run()
// spew.Dump(desc, err)
// desc, err := table.UpdateTable().Provision(2, 1).Run()
if err != nil {
t.Error(err)
}
if desc.Name != testTableWidgets {
t.Error("wrong name:", desc.Name, "≠", testTableWidgets)
}
if desc.Status != UpdatingStatus {
t.Error("bad status:", desc.Status, "≠", UpdatingStatus)
}
}