@@ -23,7 +23,6 @@ import (
2323
2424 "github.com/bytedance/mockey"
2525 . "github.com/smartystreets/goconvey/convey"
26- "github.com/west2-online/jwch"
2726
2827 "github.com/west2-online/fzuhelper-server/config"
2928 loginmodel "github.com/west2-online/fzuhelper-server/kitex_gen/model"
@@ -37,6 +36,7 @@ import (
3736 "github.com/west2-online/fzuhelper-server/pkg/taskqueue"
3837 "github.com/west2-online/fzuhelper-server/pkg/umeng"
3938 "github.com/west2-online/fzuhelper-server/pkg/utils"
39+ "github.com/west2-online/jwch"
4040 "github.com/west2-online/yjsy"
4141)
4242
@@ -50,7 +50,6 @@ func init() {
5050
5151func TestAcademicService_GetScores (t * testing.T ) {
5252 Convey ("GetScores" , t , func () {
53-
5453 Convey ("should return error when user is not logged in" , func () {
5554 // Given: 未登录的用户上下文
5655 ctx := context .Background ()
@@ -246,7 +245,6 @@ func TestAcademicService_GetScores(t *testing.T) {
246245
247246func TestAcademicService_checkScoreChange (t * testing.T ) {
248247 Convey ("checkScoreChange" , t , func () {
249-
250248 Convey ("should create new score record when student has no score history" , func () {
251249 // Given: 学生没有成绩历史记录
252250 testScores := []* jwch.Mark {
@@ -321,8 +319,10 @@ func TestAcademicService_checkScoreChange(t *testing.T) {
321319
322320 // Mock 获取旧成绩数据
323321 getScorePatch := mockey .Mock ((* academicDB .DBAcademic ).GetScoreByStuId ).Return (& dbModel.Score {
324- StuID : "222200311" ,
325- ScoresInfo : `[{"name":"数据结构","score":"90","credits":"4.0","gpa":"3.9","semester":"2024-1","teacher":"张老师","electiveType":"必修"},{"name":"计算机网络","score":"85","credits":"3.0","gpa":"3.6","semester":"2024-1","teacher":"李老师","electiveType":"必修"},{"name":"软件工程","score":"92","credits":"3.5","gpa":"4.0","semester":"2024-1","teacher":"王老师","electiveType":"选修"}]` ,
322+ StuID : "222200311" ,
323+ ScoresInfo : `[{"name":"数据结构","score":"90","credits":"4.0","gpa":"3.9","semester":"2024-1","teacher":"张老师","electiveType":"必修"},
324+ {"name":"计算机网络","score":"85","credits":"3.0","gpa":"3.6","semester":"2024-1","teacher":"李老师","electiveType":"必修"},
325+ {"name":"软件工程","score":"92","credits":"3.5","gpa":"4.0","semester":"2024-1","teacher":"王老师","electiveType":"选修"}]` ,
326326 ScoresInfoSHA256 : "old_sha256" ,
327327 }, nil ).Build ()
328328 defer getScorePatch .UnPatch ()
@@ -610,7 +610,6 @@ func TestAcademicService_checkScoreChange(t *testing.T) {
610610
611611func TestAcademicService_sendNotifications (t * testing.T ) {
612612 Convey ("sendNotifications" , t , func () {
613-
614613 Convey ("should send notifications to both Android and iOS" , func () {
615614 // Given: 准备发送推送的课程信息
616615 courseName := "数据结构"
0 commit comments