Skip to content

Commit 835b626

Browse files
added crop tests
1 parent 00b4453 commit 835b626

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

document_test.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,23 @@ func TestPostDocumentPagesResize(t *testing.T) {
341341
} else {
342342
fmt.Printf("%d\tPostDocumentPagesResize - %db\n", GetBaseTest().GetTestNumber(), response.Code)
343343
}
344-
}
344+
}
345+
346+
func TestPostDocumentPagesCrop(t *testing.T) {
347+
name := "4pages.pdf"
348+
if err := GetBaseTest().UploadFile(name); err != nil {
349+
t.Error(err)
350+
}
351+
args := map[string]interface{}{
352+
"folder": GetBaseTest().remoteFolder,
353+
}
354+
response, httpResponse, err := GetBaseTest().PdfAPI.PostDocumentPagesCrop(
355+
name, "2-3", Rectangle{LLX: 0, LLY: 0, URX: 800, URY: 400}, args)
356+
if err != nil {
357+
t.Error(err)
358+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
359+
t.Fail()
360+
} else {
361+
fmt.Printf("%d\tPostDocumentPagesCrop - %db\n", GetBaseTest().GetTestNumber(), response.Code)
362+
}
363+
}

0 commit comments

Comments
 (0)