MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / TestClientBuilder

Function TestClientBuilder

redimo_test.go:15–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestClientBuilder(t *testing.T) {
16 dynamoService := dynamodb.New(newConfig(t))
17 c1 := NewClient(dynamoService)
18 assert.Equal(t, c1.ddbClient, dynamoService)
19 assert.True(t, c1.consistentReads)
20 assert.Equal(t, "redimo", c1.table)
21 assert.Equal(t, c1.pk, c1.pk)
22 assert.False(t, c1.EventuallyConsistent().consistentReads)
23 c2 := c1.Table("table2", "index2").EventuallyConsistent()
24 assert.Equal(t, "table2", c2.table)
25 assert.Equal(t, "index2", c2.index)
26 assert.False(t, c2.consistentReads)
27 assert.True(t, c1.consistentReads)
28 assert.True(t, c2.StronglyConsistent().consistentReads)
29}
30
31func newClient(t *testing.T) Client {
32 t.Parallel()

Callers

nothing calls this directly

Calls 5

EventuallyConsistentMethod · 0.95
TableMethod · 0.95
newConfigFunction · 0.85
NewClientFunction · 0.85
StronglyConsistentMethod · 0.80

Tested by

no test coverage detected