func MustCreateWorker(t *testing.T) *Worker { db, err := sqlx.Connect("postgres", connectString()) assert.Nil(t, err) db.Execf("DROP DATABASE IF EXISTS testhkp") db.Execf("CREATE DATABASE testhkp") prlpks.SetConfig(fmt.Sprintf(` [prlpks.openpgp.db] driver="postgres" dsn="dbname=testhkp host=/var/run/postgresql sslmode=disable user=%s" `, currentUsername())) w, err := NewWorker(nil, nil) assert.Nil(t, err) return w }
func init() { prlpks.SetConfig("") }