mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 12:42:16 +01:00
fixing GoDoc + some test function names
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestHTML(t *testing.T) {
|
func TestHTML(t *testing.T) {
|
||||||
body, contentType := test.HTMLMultipartForm(t)
|
body, contentType := test.HTMLTestMultipartForm(t)
|
||||||
req := httptest.NewRequest(http.MethodPost, "/convert/html", body)
|
req := httptest.NewRequest(http.MethodPost, "/convert/html", body)
|
||||||
req.Header.Set(echo.HeaderContentType, contentType)
|
req.Header.Set(echo.HeaderContentType, contentType)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestMarkdown(t *testing.T) {
|
func TestMarkdown(t *testing.T) {
|
||||||
body, contentType := test.MarkdownMultipartForm(t)
|
body, contentType := test.MarkdownTestMultipartForm(t)
|
||||||
req := httptest.NewRequest(http.MethodPost, "/convert/markdown", body)
|
req := httptest.NewRequest(http.MethodPost, "/convert/markdown", body)
|
||||||
req.Header.Set(echo.HeaderContentType, contentType)
|
req.Header.Set(echo.HeaderContentType, contentType)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestMerge(t *testing.T) {
|
func TestMerge(t *testing.T) {
|
||||||
body, contentType := test.PDFMultipartForm(t)
|
body, contentType := test.PDFTestMultipartForm(t)
|
||||||
req := httptest.NewRequest(http.MethodPost, "/merge", body)
|
req := httptest.NewRequest(http.MethodPost, "/merge", body)
|
||||||
req.Header.Set(echo.HeaderContentType, contentType)
|
req.Header.Set(echo.HeaderContentType, contentType)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestOffice(t *testing.T) {
|
func TestOffice(t *testing.T) {
|
||||||
body, contentType := test.OfficeMultipartForm(t)
|
body, contentType := test.OfficeTestMultipartForm(t)
|
||||||
req := httptest.NewRequest(http.MethodPost, "/convert/office", body)
|
req := httptest.NewRequest(http.MethodPost, "/convert/office", body)
|
||||||
req.Header.Set(echo.HeaderContentType, contentType)
|
req.Header.Set(echo.HeaderContentType, contentType)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ For instance, if you want to convert HTML:
|
|||||||
},
|
},
|
||||||
Options: &gotenberg.HTMLOptions{
|
Options: &gotenberg.HTMLOptions{
|
||||||
HeaderFilePath: "header.html",
|
HeaderFilePath: "header.html",
|
||||||
FooterFilePath: "footer.html",
|
FooterFilePath: "footer.html",
|
||||||
PaperSize: gotenberg.A4,
|
PaperSize: gotenberg.A4,
|
||||||
PaperMargins: gotenberg.NormalMargins,
|
PaperMargins: gotenberg.NormalMargins,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
dest := "foo.pdf"
|
dest := "foo.pdf"
|
||||||
|
|||||||
@@ -16,31 +16,31 @@ import (
|
|||||||
"github.com/thecodingmachine/gotenberg/internal/pkg/rand"
|
"github.com/thecodingmachine/gotenberg/internal/pkg/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTMLMultipartForm returns the body
|
// HTMLTestMultipartForm returns the body
|
||||||
// for a multipate/form-data request with all
|
// for a multipate/form-data request with all
|
||||||
// files under "html" folder.
|
// files under "html" folder.
|
||||||
func HTMLMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
func HTMLTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||||
return multipartForm(t, "html")
|
return multipartForm(t, "html")
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarkdownMultipartForm returns the body
|
// MarkdownTestMultipartForm returns the body
|
||||||
// for a multipate/form-data request with all
|
// for a multipate/form-data request with all
|
||||||
// files under "markdown" folder.
|
// files under "markdown" folder.
|
||||||
func MarkdownMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
func MarkdownTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||||
return multipartForm(t, "markdown")
|
return multipartForm(t, "markdown")
|
||||||
}
|
}
|
||||||
|
|
||||||
// OfficeMultipartForm returns the body
|
// OfficeTestMultipartForm returns the body
|
||||||
// for a multipate/form-data request with all
|
// for a multipate/form-data request with all
|
||||||
// files under "office" folder.
|
// files under "office" folder.
|
||||||
func OfficeMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
func OfficeTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||||
return multipartForm(t, "office")
|
return multipartForm(t, "office")
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDFMultipartForm returns the body
|
// PDFTestMultipartForm returns the body
|
||||||
// for a multipate/form-data request with all
|
// for a multipate/form-data request with all
|
||||||
// files under "pdf" folder.
|
// files under "pdf" folder.
|
||||||
func PDFMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
func PDFTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||||
return multipartForm(t, "pdf")
|
return multipartForm(t, "pdf")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user