MCPcopy
hub / github.com/dosco/graphjin / createSourceModeHTTPDB

Function createSourceModeHTTPDB

serv/source_mode_http_test.go:222–244  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

220}
221
222func createSourceModeHTTPDB(t *testing.T) string {
223 t.Helper()
224
225 dbPath := filepath.Join(t.TempDir(), "source-mode-http.sqlite3")
226 db, err := sql.Open("sqlite", dbPath)
227 if err != nil {
228 t.Fatalf("open sqlite: %v", err)
229 }
230 defer db.Close()
231
232 for _, stmt := range []string{
233 `CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, account_id TEXT)`,
234 `INSERT INTO users (id, name, account_id) VALUES
235 (1, 'Ada', 'acct_1'),
236 (2, 'Bea', 'acct_2'),
237 (3, 'Cal', 'acct_1')`,
238 } {
239 if _, err := db.Exec(stmt); err != nil {
240 t.Fatalf("exec %q: %v", stmt, err)
241 }
242 }
243 return dbPath
244}
245
246func signSourceModeJWT(t *testing.T, claims jwt.MapClaims) string {
247 t.Helper()

Callers 1

Calls 3

CloseMethod · 0.65
ExecMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected