Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add test for case with pwd but no extra option
Browse files Browse the repository at this point in the history
  • Loading branch information
tnsetting committed Nov 4, 2019
1 parent 0b7ed9d commit 3b893de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/repositories/config/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@ func TestConstructGormArgsWithPassword(t *testing.T) {

assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres password=pass sslmode=enable", postgresConfigProvider.GetArgs())
}

func TestConstructGormArgsWithPasswordNoExtra(t *testing.T) {
postgresConfigProvider := NewPostgresConfigProvider(DbConfig{
Host: "localhost",
Port: 5432,
DbName: "postgres",
User: "postgres",
Password: "pass",
}, mockScope.NewTestScope())

assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres password=pass ", postgresConfigProvider.GetArgs())
}

0 comments on commit 3b893de

Please sign in to comment.