psql first commit
This commit is contained in:
21
storage/postgresql_test.go
Normal file
21
storage/postgresql_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user