MCPcopy Create free account
hub / github.com/evilsocket/sum / TestLoaderLoad

Function TestLoaderLoad

storage/loader_test.go:113–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestLoaderLoad(t *testing.T) {
114 setupRawRecords(t)
115 defer teardownRecords(t)
116
117 _, loadable, err := ListPath(testFolder)
118 if err != nil {
119 t.Fatal(err)
120 }
121
122 for _, fileName := range loadable {
123 var rec pb.Record
124 if err := Load(fileName, &rec); err != nil {
125 t.Fatalf("erorr loading %s: %s", fileName, err)
126 } else if !sameRecord(rec, testRecord) {
127 t.Fatal("records should be the same")
128 }
129 }
130}
131
132func TestLoaderLoadWithError(t *testing.T) {
133 setupRawRecords(t)

Callers

nothing calls this directly

Calls 5

setupRawRecordsFunction · 0.85
ListPathFunction · 0.85
LoadFunction · 0.85
teardownRecordsFunction · 0.70
sameRecordFunction · 0.70

Tested by

no test coverage detected