MCPcopy
hub / github.com/spacecloud-io/space-cloud / TestBolt_Create

Function TestBolt_Create

gateway/modules/crud/bolt/create_test.go:11–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestBolt_Create(t *testing.T) {
12
13 b, err := Init(true, "create.db", "bucketName")
14 if err != nil {
15 t.Fatal("error initializing database")
16 }
17
18 for _, tt := range generateCreateTestCases() {
19 t.Run(tt.name, func(t *testing.T) {
20
21 got, err := b.Create(context.Background(), tt.args.col, tt.args.req)
22 if (err != nil) != tt.wantErr {
23 t.Errorf("Create() error = %v, wantErr %v", err, tt.wantErr)
24 return
25 }
26 if got != tt.want {
27 t.Errorf("Create() got = %v, want %v", got, tt.want)
28 }
29 })
30 }
31 utils.CloseTheCloser(b)
32 if err := os.Remove("create.db"); err != nil {
33 t.Error("error removing database file:", err)
34 }
35}

Callers

nothing calls this directly

Calls 4

generateCreateTestCasesFunction · 0.85
InitFunction · 0.70
CreateMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected