MCPcopy
hub / github.com/dnote/dnote / Setup5

Function Setup5

pkg/cli/testutils/setup.go:68–77  ·  view source on GitHub ↗

Setup5 sets up a dnote env #2

(t *testing.T, db *database.DB)

Source from the content-addressed store, hash-verified

66
67// Setup5 sets up a dnote env #2
68func Setup5(t *testing.T, db *database.DB) {
69 b1UUID := "js-book-uuid"
70 b2UUID := "linux-book-uuid"
71
72 database.MustExec(t, "setting up book 1", db, "INSERT INTO books (uuid, label, usn) VALUES (?, ?, ?)", b1UUID, "js", 111)
73 database.MustExec(t, "setting up book 2", db, "INSERT INTO books (uuid, label, usn) VALUES (?, ?, ?)", b2UUID, "linux", 122)
74
75 database.MustExec(t, "setting up note 1", db, "INSERT INTO notes (uuid, book_uuid, body, added_on, usn) VALUES (?, ?, ?, ?, ?)", "f0d0fbb7-31ff-45ae-9f0f-4e429c0c797f", b1UUID, "n1 body", 1515199951, 11)
76 database.MustExec(t, "setting up note 2", db, "INSERT INTO notes (uuid, book_uuid, body, added_on, usn) VALUES (?, ?, ?, ?, ?)", "43827b9a-c2b0-4c06-a290-97991c896653", b1UUID, "n2 body", 1515199943, 12)
77}

Callers 1

TestEditNoteFunction · 0.92

Calls 1

MustExecFunction · 0.92

Tested by 1

TestEditNoteFunction · 0.74