Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-burghardt committed May 9, 2024
1 parent d23f0f5 commit a46225a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
5 changes: 0 additions & 5 deletions internal/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ var _ ConnectionPool = (*DBConnectionPoolImplementation)(nil)

type DBConnectionPoolImplementation struct {
*sqlx.DB
dataSourceName string
}

func (db *DBConnectionPoolImplementation) DSN(ctx context.Context) (string, error) {
return db.dataSourceName, nil
}

const (
Expand Down
29 changes: 11 additions & 18 deletions internal/db/dbtest/dbtest_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package dbtest

import (
"testing"

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

func TestOpen(t *testing.T) {
db := Open(t)
defer db.Close()
conn := db.Open()
defer conn.Close()

count := 0
err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`)
require.NoError(t, err)
assert.Greater(t, count, 0)
}
// func TestOpen(t *testing.T) {
// db := Open(t)
// defer db.Close()
// conn := db.Open()
// defer conn.Close()

// count := 0
// err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`)
// require.NoError(t, err)
// assert.Greater(t, count, 0)
// }

0 comments on commit a46225a

Please sign in to comment.