From 852891dbd8e3285dcfcb4031ca95307186e3db4a Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 7 Feb 2021 15:27:01 +0800 Subject: [PATCH] add more tests for stores (#445) --- core/stores/clickhouse/clickhouse_test.go | 11 +++++++++++ core/stores/postgres/postgresql.go | 2 +- core/stores/postgres/postgresql_test.go | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 core/stores/clickhouse/clickhouse_test.go create mode 100644 core/stores/postgres/postgresql_test.go diff --git a/core/stores/clickhouse/clickhouse_test.go b/core/stores/clickhouse/clickhouse_test.go new file mode 100644 index 00000000..8e14b218 --- /dev/null +++ b/core/stores/clickhouse/clickhouse_test.go @@ -0,0 +1,11 @@ +package clickhouse + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestClickHouse(t *testing.T) { + assert.NotNil(t, New("clickhouse")) +} diff --git a/core/stores/postgres/postgresql.go b/core/stores/postgres/postgresql.go index 162c678a..77800ff2 100644 --- a/core/stores/postgres/postgresql.go +++ b/core/stores/postgres/postgresql.go @@ -7,6 +7,6 @@ import ( const postgresDriverName = "postgres" -func NewPostgres(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn { +func New(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn { return sqlx.NewSqlConn(postgresDriverName, datasource, opts...) } diff --git a/core/stores/postgres/postgresql_test.go b/core/stores/postgres/postgresql_test.go new file mode 100644 index 00000000..5f7e89d6 --- /dev/null +++ b/core/stores/postgres/postgresql_test.go @@ -0,0 +1,11 @@ +package postgres + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestPostgreSql(t *testing.T) { + assert.NotNil(t, New("postgre")) +}