GetAccounts
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Tests must be run in order
|
||||
|
||||
var cfg *viper.Viper
|
||||
|
||||
func init() {
|
||||
@@ -23,8 +25,8 @@ func init() {
|
||||
|
||||
func TestNewPostgresqlStorage(t *testing.T) {
|
||||
storage, err := NewPostgresqlStorage(cfg)
|
||||
storage.DbConnection.Exec("Delete from accounts;")
|
||||
storage.DbConnection.Exec("Delete from account_auth;")
|
||||
storage.DbConnection.Exec("Delete from account_auth ;")
|
||||
storage.DbConnection.Exec("Delete from accounts ;")
|
||||
if err != nil {
|
||||
t.Errorf("error creating new PostgreSQL storage: %v", err)
|
||||
}
|
||||
@@ -261,3 +263,17 @@ func TestPostgresqlStorage_LocalAuthentication(t *testing.T) {
|
||||
}
|
||||
fmt.Println(accountByAll)
|
||||
}
|
||||
|
||||
func TestPostgresqlStorage_GetAccounts(t *testing.T) {
|
||||
db, err := NewPostgresqlStorage(cfg)
|
||||
if err != nil {
|
||||
t.Errorf("failed to create new psql connection")
|
||||
}
|
||||
accounts, err := db.GetAccounts([]string{"test_namespace", "salim", "namespace"})
|
||||
if err != nil {
|
||||
t.Errorf("Failed")
|
||||
}
|
||||
for _, account := range accounts {
|
||||
fmt.Println(account)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user