mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Tests: Add unit tests
This commit is contained in:
16
internal/api/api_response_test.go
Normal file
16
internal/api/api_response_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewResponse(t *testing.T) {
|
||||
t.Run("404", func(t *testing.T) {
|
||||
r := NewResponse(404, errors.New("not found"), "details")
|
||||
assert.Equal(t, 404, r.Code)
|
||||
assert.Equal(t, "details", r.Details)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user