Esempio n. 1
0
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
}
Esempio n. 2
0
func init() {
	prlpks.SetConfig("")
}