We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07c75b4 commit bd0c2dcCopy full SHA for bd0c2dc
1 file changed
db/sqlite_test.go
@@ -2,6 +2,7 @@ package db
2
3
import (
4
"fmt"
5
+ "io/ioutil"
6
"os"
7
"testing"
8
"time"
@@ -17,16 +18,18 @@ const (
17
18
19
type SQLiteSuite struct {
20
suite.Suite
- db Database
21
+ tempDir string
22
+ db Database
23
}
24
25
func (s *SQLiteSuite) SetupSuite() {
- configs.Config.DatabaseURL = fmt.Sprintf("./%s", testDbName)
26
+ s.tempDir, _ = ioutil.TempDir("", "testg2t")
27
+ configs.Config.DatabaseURL = fmt.Sprintf("%s/%s", s.tempDir, testDbName)
28
s.db = NewSQLite()
29
30
31
func (s *SQLiteSuite) TearDownSuite() {
- os.Remove(testDbName)
32
+ os.RemoveAll(s.tempDir)
33
34
35
func (s *SQLiteSuite) TestUpdateLastUpdateTime() {
0 commit comments