mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
improving context timeout tests for office and merge printers + test with only one file to convert for the office printer
This commit is contained in:
@@ -34,7 +34,7 @@ func TestMergePrinter(t *testing.T) {
|
|||||||
// should not be OK as context.Context
|
// should not be OK as context.Context
|
||||||
// should timeout.
|
// should timeout.
|
||||||
opts = MergePrinterOptions{
|
opts = MergePrinterOptions{
|
||||||
WaitTimeout: 0.1,
|
WaitTimeout: 0.0,
|
||||||
}
|
}
|
||||||
p = NewMergePrinter(logger, fpaths, opts)
|
p = NewMergePrinter(logger, fpaths, opts)
|
||||||
dest = printertest.GenerateDestination()
|
dest = printertest.GenerateDestination()
|
||||||
|
|||||||
@@ -32,6 +32,17 @@ func TestOfficePrinter(t *testing.T) {
|
|||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
err = os.RemoveAll(dest)
|
err = os.RemoveAll(dest)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
// using one file.
|
||||||
|
opts = OfficePrinterOptions{
|
||||||
|
WaitTimeout: 10.0,
|
||||||
|
Landscape: false,
|
||||||
|
}
|
||||||
|
p = NewOfficePrinter(logger, []string{fpaths[0]}, opts)
|
||||||
|
dest = printertest.GenerateDestination()
|
||||||
|
err = p.Print(dest)
|
||||||
|
assert.Nil(t, err)
|
||||||
|
err = os.RemoveAll(dest)
|
||||||
|
assert.Nil(t, err)
|
||||||
// options with landscape.
|
// options with landscape.
|
||||||
opts = OfficePrinterOptions{
|
opts = OfficePrinterOptions{
|
||||||
WaitTimeout: 10.0,
|
WaitTimeout: 10.0,
|
||||||
@@ -46,7 +57,7 @@ func TestOfficePrinter(t *testing.T) {
|
|||||||
// should not be OK as context.Context
|
// should not be OK as context.Context
|
||||||
// should timeout.
|
// should timeout.
|
||||||
opts = OfficePrinterOptions{
|
opts = OfficePrinterOptions{
|
||||||
WaitTimeout: 1.0,
|
WaitTimeout: 0.0,
|
||||||
Landscape: true,
|
Landscape: true,
|
||||||
}
|
}
|
||||||
p = NewOfficePrinter(logger, fpaths, opts)
|
p = NewOfficePrinter(logger, fpaths, opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user