1
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
This commit is contained in:
38
app/jobs/translate_test.go
Normal file
38
app/jobs/translate_test.go
Normal file
@ -0,0 +1,38 @@
|
||||
package jobs
|
||||
|
||||
import (
|
||||
"go-admin/utils/redishelper"
|
||||
"testing"
|
||||
|
||||
"github.com/go-admin-team/go-admin-core/sdk"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func TestTranslate(t *testing.T) {
|
||||
dsn := "root:123456@tcp(127.0.0.1:3306)/aggregate_translate?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
|
||||
db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
sdk.Runtime.SetDb("default", db)
|
||||
|
||||
redishelper.InitDefaultRedis("127.0.0.1:6379", "", 1)
|
||||
redishelper.InitLockRedisConn("127.0.0.1:6379", "", "1")
|
||||
job := DailyJob{}
|
||||
|
||||
if err := job.Exec(nil); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemainTranslate(t *testing.T) {
|
||||
dsn := "root:123456@tcp(127.0.0.1:3306)/aggregate_translate?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
|
||||
db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
sdk.Runtime.SetDb("default", db)
|
||||
|
||||
redishelper.InitDefaultRedis("127.0.0.1:6379", "", 1)
|
||||
redishelper.InitLockRedisConn("127.0.0.1:6379", "", "1")
|
||||
job := RemainCharJob{}
|
||||
|
||||
if err := job.Exec(nil); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user