improving tests code coverage of app package

This commit is contained in:
Julien Neuhart
2018-04-11 17:57:18 +02:00
parent d43fb62cd8
commit 37e2958e7b

View File

@@ -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()