forked from guregu/dynamo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updatetable_test.go
41 lines (36 loc) · 917 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
package dynamo
import (
"testing"
)
// TODO: enable this test
func _TestUpdateTable(t *testing.T) {
if testDB == nil {
t.Skip(offlineSkipMsg)
}
table := testDB.Table(testTable)
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()
// 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 != testTable {
t.Error("wrong name:", desc.Name, "≠", testTable)
}
if desc.Status != UpdatingStatus {
t.Error("bad status:", desc.Status, "≠", UpdatingStatus)
}
}