From 37e2958e7b7dfae2b1827ed835406bae68347e77 Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Wed, 11 Apr 2018 17:57:18 +0200 Subject: [PATCH] improving tests code coverage of app package --- app/handlers_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/handlers_test.go b/app/handlers_test.go index 1e150625..2be7d6b9 100644 --- a/app/handlers_test.go +++ b/app/handlers_test.go @@ -56,6 +56,13 @@ func fakeSuccessHandler(w http.ResponseWriter, r *http.Request) { 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) { var ( req *http.Request @@ -136,7 +143,7 @@ func TestConvertHandler(t *testing.T) { loadCommandConfigs("../_tests/configurations/merge-timeout-gotenberg.yml") // 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") req = makeRequest(path, oPath) rr = httptest.NewRecorder()