Skip to content

Commit ffa9ed3

Browse files
author
jojoliang
committed
update batch test
1 parent 6a05212 commit ffa9ed3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

batch_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ func TestBatchService_DescribeJob(t *testing.T) {
194194
if !reflect.DeepEqual(ref, want) {
195195
t.Errorf("Batch.DescribeJob returned %+v, want %+v", ref, want)
196196
}
197-
198197
}
199198

200199
func TestBatchService_ListJobs(t *testing.T) {
@@ -387,3 +386,21 @@ func TestBatchService_UpdateJobsStatus(t *testing.T) {
387386
t.Errorf("Batch.UpdateJobsStatus returned %+v, want %+v", ref, want)
388387
}
389388
}
389+
390+
func TestBatchService_DeleteJob(t *testing.T) {
391+
setup()
392+
defer teardown()
393+
394+
mux.HandleFunc("/jobs/53dc6228-c50b-46f7-8ad7-65e7159f1aae", func(w http.ResponseWriter, r *http.Request) {
395+
testHeader(t, r, "x-cos-appid", "1250000000")
396+
testMethod(t, r, http.MethodDelete)
397+
})
398+
399+
headers := &BatchRequestHeaders{
400+
XCosAppid: 1250000000,
401+
}
402+
_, err := client.Batch.DeleteJob(context.Background(), "53dc6228-c50b-46f7-8ad7-65e7159f1aae", headers)
403+
if err != nil {
404+
t.Fatalf("Batch.DescribeJob returned error: %v", err)
405+
}
406+
}

0 commit comments

Comments
 (0)