mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-26 08:29:41 -05:00
26 lines
608 B
Go
26 lines
608 B
Go
package web
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/gtsteffaniak/filebrowser/backend/internal/transcoding"
|
|
)
|
|
|
|
func TestTranscodeErrorStatus(t *testing.T) {
|
|
tests := []struct {
|
|
err error
|
|
status int
|
|
}{
|
|
{transcoding.ErrNotFound, http.StatusNotFound},
|
|
{transcoding.ErrUserLimit, http.StatusConflict},
|
|
{transcoding.ErrGlobalLimit, http.StatusServiceUnavailable},
|
|
{transcoding.ErrUnsupportedMedia, http.StatusUnprocessableEntity},
|
|
}
|
|
for _, tc := range tests {
|
|
if got := transcodeErrorStatus(tc.err); got != tc.status {
|
|
t.Fatalf("%v: got %d want %d", tc.err, got, tc.status)
|
|
}
|
|
}
|
|
}
|