-
-
Notifications
You must be signed in to change notification settings - Fork 178
/
ttl_test.go
52 lines (44 loc) · 1.06 KB
/
ttl_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
44
45
46
47
48
49
50
51
52
package dynamo
import (
"context"
"testing"
)
func TestDescribeTTL(t *testing.T) {
if testDB == nil {
t.Skip(offlineSkipMsg)
}
table := testDB.Table(testTableWidgets)
ctx := context.TODO()
desc, err := table.DescribeTTL().Run(ctx)
if err != nil {
t.Error(err)
return
}
if desc.Status != TTLDisabled {
t.Error("wrong status:", desc.Status, "≠", TTLDisabled)
}
}
// disable until we have local DB tests
// (AWS doesn't let us change the TTL often enough to test on a real DB)
// func TestUpdateTTL(t *testing.T) {
// if testDB == nil {
// t.Skip(offlineSkipMsg)
// }
// table := testDB.Table(testTable)
// err := table.UpdateTTL("Date", true).Run()
// if err != nil {
// t.Error(err)
// return
// }
// desc, err := table.DescribeTTL().Run()
// if err != nil {
// t.Error(err)
// return
// }
// if desc.Status != TTLEnabled && desc.Status != TTLEnabling {
// t.Error("wrong status:", desc.Status, "≠ ENABLED or ENABLING")
// }
// if desc.Attribute != "Date" {
// t.Error("wrong attribute:", desc.Attribute, "≠", "Date")
// }
// }