MCPcopy Index your code
hub / github.com/dnote/dnote / MustUUID

Function MustUUID

pkg/server/testutils/main.go:68–74  ·  view source on GitHub ↗

MustUUID generates a UUID and fails the test on error

(t *testing.T)

Source from the content-addressed store, hash-verified

66
67// MustUUID generates a UUID and fails the test on error
68func MustUUID(t *testing.T) string {
69 uuid, err := helpers.GenUUID()
70 if err != nil {
71 t.Fatal(errors.Wrap(err, "Failed to generate UUID"))
72 }
73 return uuid
74}
75
76// SetupUserData creates and returns a new user with email and password for testing purposes
77func SetupUserData(db *gorm.DB, email, password string) database.User {

Callers 13

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

Calls 1

GenUUIDFunction · 0.92

Tested by 13

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