package db_test

import (
	"testing"

	"github.com/go-pg/pg/v10"

	m "github.com/fiskerinc/cloud-services/pkg/common"
	"github.com/fiskerinc/cloud-services/pkg/db"
	"github.com/fiskerinc/cloud-services/pkg/testhelper"
)

func TestDBClient(t *testing.T) {
	client := db.DBClient{}
	client.SetConn(pg.Connect(&pg.Options{}))
	defer client.Close()

	err := client.InitSchema([]interface{}{
		(*m.Car)(nil),
	})
	if err == nil {
		t.Errorf(testhelper.TestErrorTemplate, "TestDBCreateSchema", "error", err)
	}
}
