MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestBoltDbStore_GetLog

Function TestBoltDbStore_GetLog

lib/datastore/boltdb_test.go:98–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96
97}
98func TestBoltDbStore_GetLog(t *testing.T) {
99 r, err := testBoltDatastore()
100 assert.NoError(t, err)
101 logs := []*raft.Log{
102 createRaftLog(1, "test1"),
103 createRaftLog(2, "test2"),
104 createRaftLog(23, "test3"),
105 }
106 err = r.StoreLogs(logs)
107 assert.NoError(t, err)
108 // get the logs
109 var log raft.Log
110 err = r.GetLog(1, &log)
111 assert.NoError(t, err)
112 assert.Equal(t, log, *logs[0])
113 // get log of id 23
114 err = r.GetLog(23, &log)
115 assert.NoError(t, err)
116 assert.Equal(t, log, *logs[2])
117
118}
119func TestBoltDbStore_StoreLog(t *testing.T) {
120 r, err := testBoltDatastore()
121 assert.NoError(t, err)

Callers

nothing calls this directly

Calls 4

testBoltDatastoreFunction · 0.85
createRaftLogFunction · 0.85
StoreLogsMethod · 0.45
GetLogMethod · 0.45

Tested by

no test coverage detected