mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-18 09:05:25 +00:00
25 lines
650 B
Go
25 lines
650 B
Go
package status
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestErrCanceled(t *testing.T) {
|
|
assert.EqualError(t, ErrCanceled, Canceled)
|
|
|
|
wrapped := fmt.Errorf("worker stopped: %w", ErrCanceled)
|
|
assert.True(t, errors.Is(wrapped, ErrCanceled))
|
|
assert.False(t, errors.Is(wrapped, ErrInsufficientStorage))
|
|
}
|
|
|
|
func TestErrInsufficientStorage(t *testing.T) {
|
|
assert.EqualError(t, ErrInsufficientStorage, InsufficientStorage)
|
|
|
|
wrapped := fmt.Errorf("scheduler: %w (backup)", ErrInsufficientStorage)
|
|
assert.True(t, errors.Is(wrapped, ErrInsufficientStorage))
|
|
assert.False(t, errors.Is(wrapped, ErrCanceled))
|
|
}
|