mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 12:22:17 +01:00
improving code coverage
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
@@ -40,3 +41,18 @@ func TestSniffContentType(t *testing.T) {
|
||||
t.Error("It should have been able to retrieve an authorized content type from a PDF file!")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNotAuthorizedContentTypeError(t *testing.T) {
|
||||
err := ¬AuthorizedContentTypeError{}
|
||||
message := fmt.Sprintf("Accepted values for 'Content-Type': %s, %s", OctetStreamContentType, MultipartFormDataContentType)
|
||||
if err.Error() != message {
|
||||
t.Errorf("Error returned a wrong message: got %s want %s", err.Error(), message)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNotAuthorizedFileContentTypeError(t *testing.T) {
|
||||
err := ¬AuthorizedFileContentTypeError{}
|
||||
if err.Error() != notAuthorizedFileContentTypeErrorMessage {
|
||||
t.Errorf("Error returned a wrong message: got %s want %s", err.Error(), notAuthorizedFileContentTypeErrorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user