mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 04:32:15 +01:00
fix(qpdf): allow warnings (#1135)
* Optionally allow warnings in QPDF operations * warnings are not errors by default * Apply suggestions from code review Co-authored-by: Julien Neuhart <neuhart.julien@gmail.com> * fix some merge artifacts * follow the args convention --------- Co-authored-by: Julien Neuhart <neuhart.julien@gmail.com>
This commit is contained in:
@@ -154,6 +154,15 @@ func TestQPdf_Merge(t *testing.T) {
|
||||
},
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
scenario: "success even with warnings",
|
||||
ctx: context.TODO(),
|
||||
inputPaths: []string{
|
||||
"/tests/test/testdata/pdfengines/sample1.pdf",
|
||||
"/tests/test/testdata/pdfengines/sample5.pdf",
|
||||
},
|
||||
expectError: false,
|
||||
},
|
||||
} {
|
||||
t.Run(tc.scenario, func(t *testing.T) {
|
||||
engine := new(QPdf)
|
||||
@@ -236,6 +245,14 @@ func TestQPdf_Split(t *testing.T) {
|
||||
expectError: false,
|
||||
expectOutputPathsCount: 1,
|
||||
},
|
||||
{
|
||||
scenario: "success even with warnings",
|
||||
ctx: context.TODO(),
|
||||
mode: gotenberg.SplitMode{Mode: gotenberg.SplitModePages, Span: "1-2", Unify: true},
|
||||
inputPath: "/tests/test/testdata/pdfengines/sample5.pdf",
|
||||
expectError: false,
|
||||
expectOutputPathsCount: 1,
|
||||
},
|
||||
} {
|
||||
t.Run(tc.scenario, func(t *testing.T) {
|
||||
engine := new(QPdf)
|
||||
@@ -304,6 +321,13 @@ func TestQPdf_Flatten(t *testing.T) {
|
||||
createCopy: true,
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
scenario: "success even with warnings",
|
||||
ctx: context.TODO(),
|
||||
inputPath: "/tests/test/testdata/pdfengines/sample5.pdf",
|
||||
createCopy: true,
|
||||
expectError: false,
|
||||
},
|
||||
} {
|
||||
t.Run(tc.scenario, func(t *testing.T) {
|
||||
engine := new(QPdf)
|
||||
|
||||
Reference in New Issue
Block a user