MCPcopy
hub / github.com/dnote/dnote / MustExec

Function MustExec

pkg/server/testutils/main.go:182–186  ·  view source on GitHub ↗

MustExec fails the test if the given database query has error

(t *testing.T, db *gorm.DB, message string)

Source from the content-addressed store, hash-verified

180
181// MustExec fails the test if the given database query has error
182func MustExec(t *testing.T, db *gorm.DB, message string) {
183 if err := db.Error; err != nil {
184 t.Fatalf("%s: %s", message, err.Error())
185 }
186}
187
188// GetCookieByName returns a cookie with the given name
189func GetCookieByName(cookies []*http.Cookie, name string) *http.Cookie {

Callers 15

TestViewNoteFunction · 0.92
TestGetNotesFunction · 0.92
TestGetNoteFunction · 0.92
TestCreateNoteFunction · 0.92
TestDeleteNoteFunction · 0.92
TestUpdateNoteFunction · 0.92
TestGetBooksFunction · 0.92
TestGetBooksByNameFunction · 0.92
TestGetBookFunction · 0.92
TestGetBookNonOwnerFunction · 0.92
TestCreateBookFunction · 0.92
TestUpdateBookFunction · 0.92

Calls 1

ErrorMethod · 0.45

Tested by 15

TestViewNoteFunction · 0.74
TestGetNotesFunction · 0.74
TestGetNoteFunction · 0.74
TestCreateNoteFunction · 0.74
TestDeleteNoteFunction · 0.74
TestUpdateNoteFunction · 0.74
TestGetBooksFunction · 0.74
TestGetBooksByNameFunction · 0.74
TestGetBookFunction · 0.74
TestGetBookNonOwnerFunction · 0.74
TestCreateBookFunction · 0.74
TestUpdateBookFunction · 0.74