2025-01-10 11:12:03 +00:00
|
|
|
package server_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-01-14 17:28:26 +00:00
|
|
|
"os"
|
|
|
|
|
"path"
|
2025-01-10 11:12:03 +00:00
|
|
|
"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-15 12:19:49 +00:00
|
|
|
_, cleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{})
|
2025-01-10 11:12:03 +00:00
|
|
|
defer cleanup()
|
|
|
|
|
|
|
|
|
|
newCfg := &server.NewConfig{
|
2025-01-14 17:28:26 +00:00
|
|
|
BasePath: path.Join(os.Getenv("PWD"), "../.."),
|
2025-01-10 11:12:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cfg := server.New(ctx, newCfg)
|
|
|
|
|
assert.NotNil(t, cfg)
|
|
|
|
|
}
|