From 9ed5c633e562c944f5eb41c52ae1e1d699aceed0 Mon Sep 17 00:00:00 2001 From: Andrew Sweeney Date: Wed, 3 May 2017 11:08:33 -0400 Subject: [PATCH] Add basic postgres cache tests (#5) * Add basic postgres cache tests --- cache/postgres_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cache/postgres_test.go diff --git a/cache/postgres_test.go b/cache/postgres_test.go new file mode 100644 index 00000000000..af0ad182305 --- /dev/null +++ b/cache/postgres_test.go @@ -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")) +}