mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 20:32:13 +01:00
adding test for printer package
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/thecodingmachine/gotenberg/internal/pkg/conf"
|
||||
"github.com/thecodingmachine/gotenberg/internal/pkg/xerror"
|
||||
"github.com/thecodingmachine/gotenberg/internal/pkg/xlog"
|
||||
"github.com/thecodingmachine/gotenberg/test"
|
||||
@@ -13,6 +14,7 @@ import (
|
||||
func TestMergePrinter(t *testing.T) {
|
||||
var (
|
||||
logger xlog.Logger = test.DebugLogger()
|
||||
config conf.Config = conf.DefaultConfig()
|
||||
fpaths []string = test.MergeFpaths(t)
|
||||
opts MergePrinterOptions
|
||||
dest string
|
||||
@@ -20,9 +22,7 @@ func TestMergePrinter(t *testing.T) {
|
||||
err error
|
||||
)
|
||||
// default options.
|
||||
opts = MergePrinterOptions{
|
||||
WaitTimeout: 10.0,
|
||||
}
|
||||
opts = DefaultMergePrinterOptions(config)
|
||||
p = NewMergePrinter(logger, fpaths, opts)
|
||||
dest = test.GenerateDestination()
|
||||
err = p.Print(dest)
|
||||
@@ -31,9 +31,8 @@ func TestMergePrinter(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
// should not be OK as context.Context
|
||||
// should timeout.
|
||||
opts = MergePrinterOptions{
|
||||
WaitTimeout: 0.0,
|
||||
}
|
||||
opts = DefaultMergePrinterOptions(config)
|
||||
opts.WaitTimeout = 0.0
|
||||
p = NewMergePrinter(logger, fpaths, opts)
|
||||
dest = test.GenerateDestination()
|
||||
err = p.Print(dest)
|
||||
|
||||
Reference in New Issue
Block a user