2025-01-10 11:12:03 +00:00
|
|
|
package server_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"queryorchestration/internal/server"
|
2025-01-10 19:17:20 +00:00
|
|
|
"queryorchestration/internal/test"
|
2025-01-10 11:12:03 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestNew(t *testing.T) {
|
|
|
|
|
ctx := context.Background()
|
|
|
|
|
|
2025-01-10 19:17:20 +00:00
|
|
|
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
|
|
|
|
NoPool: true,
|
|
|
|
|
})
|
2025-01-10 11:12:03 +00:00
|
|
|
defer cleanup()
|
|
|
|
|
|
|
|
|
|
newCfg := &server.NewConfig{
|
|
|
|
|
BasePath: "../..",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cfg := server.New(ctx, newCfg)
|
|
|
|
|
assert.NotNil(t, cfg)
|
|
|
|
|
}
|