2025-03-20 11:06:41 +00:00
|
|
|
package database
|
2025-01-31 13:43:55 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
2025-03-05 12:05:46 +00:00
|
|
|
"queryorchestration/internal/serviceconfig/database"
|
|
|
|
|
|
2025-01-31 13:43:55 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestCreateDB(t *testing.T) {
|
2025-06-03 13:52:10 +00:00
|
|
|
ctx := t.Context()
|
2025-02-03 17:30:50 +00:00
|
|
|
cfg := &database.DBConfig{
|
|
|
|
|
DBHost: "invalid_value",
|
|
|
|
|
}
|
2025-01-31 13:43:55 +00:00
|
|
|
|
2025-04-22 14:40:16 +00:00
|
|
|
err := createDB(ctx, cfg)
|
2025-01-31 13:43:55 +00:00
|
|
|
assert.Error(t, err)
|
|
|
|
|
}
|