tests for process package

This commit is contained in:
Julien Neuhart
2018-04-05 11:24:14 +02:00
parent ee15a52001
commit 62ad3e20fa
3 changed files with 150 additions and 2 deletions

View File

@@ -27,8 +27,10 @@ type conversionData struct {
type impossibleConversionError struct{}
const impossibleConversionErrorMessage = "Impossible conversion"
func (e *impossibleConversionError) Error() string {
return "Impossible conversion"
return impossibleConversionErrorMessage
}
// Unconv converts a file to PDF and returns the new file path.
@@ -100,8 +102,10 @@ func Merge(workingDir string, filesPaths []string) (string, error) {
type commandTimeoutError struct{}
const commandTimeoutErrorMessage = "The command has reached timeout"
func (e *commandTimeoutError) Error() string {
return "The command has reached timeout"
return commandTimeoutErrorMessage
}
// run runs the given command. If timeout is reached or