Skip to content

Commit 76471b5

Browse files
committed
fix: test cases
1 parent e340138 commit 76471b5

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

api/handler/api/course_service_test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,20 @@ func TestUpsertCustomCourse(t *testing.T) {
220220

221221
testCases := []testCase{
222222
{
223-
name: "success",
224-
url: "/api/v2/jwch/course/upsert",
225-
body: `{"term":"202401","course":{"name":"x","location":"y","start_class":1,"end_class":2,"start_week":1,"end_week":2,"weekday":1}}`,
223+
name: "success",
224+
url: "/api/v2/jwch/course/upsert",
225+
body: `{"term":"202401","course":` +
226+
`{"name":"x","location":"y","start_class":1,"end_class":2,` +
227+
`"start_week":1,"end_week":2,"weekday":1,"single":false,"double_":false}}`,
226228
mockResp: &course.UpsertCustomCourseResponse{},
227229
expectContains: `{"code":"10000","message":"ok","data":`,
228230
},
229231
{
230-
name: "rpc error",
231-
url: "/api/v2/jwch/course/upsert",
232-
body: `{"term":"202401","course":{"name":"x","location":"y","start_class":1,"end_class":2,"start_week":1,"end_week":2,"weekday":1}}`,
232+
name: "rpc error",
233+
url: "/api/v2/jwch/course/upsert",
234+
body: `{"term":"202401","course":` +
235+
`{"name":"x","location":"y","start_class":1,"end_class":2,` +
236+
`"start_week":1,"end_week":2,"weekday":1,"single":false,"double_":false}}`,
233237
mockErr: errno.InternalServiceError,
234238
expectContains: `{"code":"50001","message":"内部服务错误"}`,
235239
},

0 commit comments

Comments
 (0)