15adaebfcd
DRAFT PR : WIP working through ideas for integration * movearound * attempttwo * openapi * further sanding * fix * start on tests * runthroughsingleconfig * somechanges * reflectissue * removeerrs * mostlyremovepanic * removeenv * noncfgtests * go * repo * fix service config test * add PWD to all * test fix * fix lint * todo for later * passingunittests * alltests * testlogger * testloggername * clean
25 lines
536 B
Go
25 lines
536 B
Go
package client_test
|
|
|
|
import (
|
|
"queryorchestration/internal/client"
|
|
"queryorchestration/internal/database/repository"
|
|
"queryorchestration/internal/serviceconfig"
|
|
"testing"
|
|
|
|
"github.com/pashagolub/pgxmock/v3"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestService(t *testing.T) {
|
|
pool, err := pgxmock.NewPool()
|
|
if err != nil {
|
|
t.Fatalf("failed to open pgxmock database: %v", err)
|
|
}
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
cfg.DBPool = pool
|
|
cfg.DBQueries = repository.New(pool)
|
|
|
|
svc := client.New(cfg)
|
|
assert.NotNil(t, svc)
|
|
}
|