(t *testing.T)
| 220 | } |
| 221 | |
| 222 | func 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 | |
| 246 | func signSourceModeJWT(t *testing.T, claims jwt.MapClaims) string { |
| 247 | t.Helper() |
no test coverage detected