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:
@@ -11,41 +11,51 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// MergeMultipartForm returns the body
|
||||
// for a multipart/form-data request with all
|
||||
// files under "pdf" folder.
|
||||
/*
|
||||
MergeMultipartForm returns the body
|
||||
for a multipart/form-data request with all
|
||||
files under "testdata/pdf" folder.
|
||||
*/
|
||||
func MergeMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string) {
|
||||
fpaths := MergeFpaths(t)
|
||||
return multipartForm(t, "pdf", formValues, fpaths)
|
||||
}
|
||||
|
||||
// HTMLMultipartForm returns the body
|
||||
// for a multipart/form-data request with all
|
||||
// files under "html" folder.
|
||||
/*
|
||||
HTMLMultipartForm returns the body
|
||||
for a multipart/form-data request with all
|
||||
files under "testdata/html" folder.
|
||||
*/
|
||||
func HTMLMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string) {
|
||||
// TODO
|
||||
return multipartForm(t, "html", formValues, []string{})
|
||||
fpaths := HTMLFpaths(t)
|
||||
return multipartForm(t, "html", formValues, fpaths)
|
||||
}
|
||||
|
||||
// URLMultipartForm returns the body
|
||||
// for a multipart/form-data request with all
|
||||
// files under "url" folder.
|
||||
/*
|
||||
URLMultipartForm returns the body
|
||||
for a multipart/form-data request with all
|
||||
files under "testdata/url" folder.
|
||||
*/
|
||||
func URLMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string) {
|
||||
// TODO
|
||||
return multipartForm(t, "url", formValues, []string{})
|
||||
fpaths := URLFpaths(t)
|
||||
return multipartForm(t, "url", formValues, fpaths)
|
||||
}
|
||||
|
||||
// MarkdownMultipartForm returns the body
|
||||
// for a multipart/form-data request with all
|
||||
// files under "markdown" folder.
|
||||
/*
|
||||
MarkdownMultipartForm returns the body
|
||||
for a multipart/form-data request with all
|
||||
files under "testdata/markdown" folder.
|
||||
*/
|
||||
func MarkdownMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string) {
|
||||
// TODO
|
||||
return multipartForm(t, "markdown", formValues, []string{})
|
||||
fpaths := MarkdownFpaths(t)
|
||||
return multipartForm(t, "markdown", formValues, fpaths)
|
||||
}
|
||||
|
||||
// OfficeMultipartForm returns the body
|
||||
// for a multipart/form-data request with all
|
||||
// files under "office" folder.
|
||||
/*
|
||||
OfficeMultipartForm returns the body
|
||||
for a multipart/form-data request with all
|
||||
files under "testdata/office" folder.
|
||||
*/
|
||||
func OfficeMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string) {
|
||||
fpaths := OfficeFpaths(t)
|
||||
return multipartForm(t, "office", formValues, fpaths)
|
||||
|
||||
Reference in New Issue
Block a user