mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
improving tests code coverage of app package
This commit is contained in:
@@ -56,6 +56,13 @@ func fakeSuccessHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetHandlersChain(t *testing.T) {
|
||||||
|
// dumb test to improve code coverage...
|
||||||
|
if GetHandlersChain() == nil {
|
||||||
|
t.Errorf("Handler chains should not be nil")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestEnforceContentLengthHandler(t *testing.T) {
|
func TestEnforceContentLengthHandler(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
req *http.Request
|
req *http.Request
|
||||||
@@ -136,7 +143,7 @@ func TestConvertHandler(t *testing.T) {
|
|||||||
loadCommandConfigs("../_tests/configurations/merge-timeout-gotenberg.yml")
|
loadCommandConfigs("../_tests/configurations/merge-timeout-gotenberg.yml")
|
||||||
|
|
||||||
// case 3: sends a request with two files and using an unsuitable timeout for merge commande.
|
// case 3: sends a request with two files and using an unsuitable timeout for merge commande.
|
||||||
path, _ = filepath.Abs("../_tests/configurations/gotenberg.yml")
|
path, _ = filepath.Abs("../_tests/file.pdf")
|
||||||
oPath, _ = filepath.Abs("../_tests/file.docx")
|
oPath, _ = filepath.Abs("../_tests/file.docx")
|
||||||
req = makeRequest(path, oPath)
|
req = makeRequest(path, oPath)
|
||||||
rr = httptest.NewRecorder()
|
rr = httptest.NewRecorder()
|
||||||
|
|||||||
Reference in New Issue
Block a user