22 lines
531 B
Go
22 lines
531 B
Go
package storage
|
|
|
|
import (
|
|
"github.com/spf13/viper"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewPostgresqlStorage(t *testing.T) {
|
|
cfg := viper.New()
|
|
cfg.Set("storage.db.psql.host", "localhost")
|
|
cfg.Set("storage.db.psql.port", "5432")
|
|
cfg.Set("storage.db.psql.user", "postgres")
|
|
cfg.Set("storage.db.psql.password", "postgres")
|
|
cfg.Set("storage.db.psql.dbname", "mobilityaccounts")
|
|
|
|
storage, err := NewPostgresqlStorage(cfg)
|
|
if err != nil {
|
|
t.Errorf("error creating new PostgreSQL storage: %v", err)
|
|
}
|
|
defer storage.DbConnection.Close()
|
|
}
|