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

Function Setup1

pkg/cli/testutils/setup.go:25–33  ·  view source on GitHub ↗

Setup1 sets up a dnote env #1

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

Source from the content-addressed store, hash-verified

23
24// Setup1 sets up a dnote env #1
25func Setup1(t *testing.T, db *database.DB) {
26 b1UUID := "js-book-uuid"
27 b2UUID := "linux-book-uuid"
28
29 database.MustExec(t, "setting up book 1", db, "INSERT INTO books (uuid, label) VALUES (?, ?)", b1UUID, "js")
30 database.MustExec(t, "setting up book 2", db, "INSERT INTO books (uuid, label) VALUES (?, ?)", b2UUID, "linux")
31
32 database.MustExec(t, "setting up note 1", db, "INSERT INTO notes (uuid, book_uuid, body, added_on) VALUES (?, ?, ?, ?)", "43827b9a-c2b0-4c06-a290-97991c896653", b1UUID, "Booleans have toString()", 1515199943)
33}
34
35// Setup2 sets up a dnote env #2
36func Setup2(t *testing.T, db *database.DB) {

Callers 2

TestEditBookFunction · 0.92
TestViewFunction · 0.92

Calls 1

MustExecFunction · 0.92

Tested by 2

TestEditBookFunction · 0.74
TestViewFunction · 0.74