MCPcopy
hub / github.com/dnote/dnote / Setup2

Function Setup2

pkg/cli/testutils/setup.go:36–46  ·  view source on GitHub ↗

Setup2 sets up a dnote env #2

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

Source from the content-addressed store, hash-verified

34
35// Setup2 sets up a dnote env #2
36func Setup2(t *testing.T, db *database.DB) {
37 b1UUID := "js-book-uuid"
38 b2UUID := "linux-book-uuid"
39
40 database.MustExec(t, "setting up book 1", db, "INSERT INTO books (uuid, label, usn) VALUES (?, ?, ?)", b1UUID, "js", 111)
41 database.MustExec(t, "setting up book 2", db, "INSERT INTO books (uuid, label, usn) VALUES (?, ?, ?)", b2UUID, "linux", 122)
42
43 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)
44 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)
45 database.MustExec(t, "setting up note 3", db, "INSERT INTO notes (uuid, book_uuid, body, added_on, usn) VALUES (?, ?, ?, ?, ?)", "3e065d55-6d47-42f2-a6bf-f5844130b2d2", b2UUID, "n3 body", 1515199961, 13)
46}
47
48// Setup3 sets up a dnote env #3
49func Setup3(t *testing.T, db *database.DB) {

Callers 3

TestRemoveNoteFunction · 0.92
TestRemoveBookFunction · 0.92
TestViewFunction · 0.92

Calls 1

MustExecFunction · 0.92

Tested by 3

TestRemoveNoteFunction · 0.74
TestRemoveBookFunction · 0.74
TestViewFunction · 0.74