Преглед на файлове

add more tests for stores (#445)

Kevin Wan преди 3 години
родител
ревизия
852891dbd8
променени са 3 файла, в които са добавени 23 реда и са изтрити 1 реда
  1. 11 0
      core/stores/clickhouse/clickhouse_test.go
  2. 1 1
      core/stores/postgres/postgresql.go
  3. 11 0
      core/stores/postgres/postgresql_test.go

+ 11 - 0
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"))
+}

+ 1 - 1
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...)
 }

+ 11 - 0
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"))
+}