Skip to content

Commit

Permalink
Add basic postgres cache tests (#5)
Browse files Browse the repository at this point in the history
* Add basic postgres cache tests
  • Loading branch information
asweeney86 authored May 3, 2017
1 parent b3800bb commit 9ed5c63
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cache/postgres_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cache

import (
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

func TestPostgresConfig(t *testing.T) {
conf := PostgresDataCacheConfig{
Host: "host",
Port: 1234,
Dbname: "dbname",
User: "user",
Password: "password",
TTL: 3434,
Size: 100,
}

u := conf.uri()
assert.True(t, strings.Contains(u, "host=host"))
assert.True(t, strings.Contains(u, "port=1234"))
assert.True(t, strings.Contains(u, "dbname=dbname"))
assert.True(t, strings.Contains(u, "user=user"))
assert.True(t, strings.Contains(u, "password=password"))
}

0 comments on commit 9ed5c63

Please sign in to comment.