This commit is contained in:
Vladislav Kunetskiy
2026-11-06 17:30:30 +03:00
parent 470d9d6f1e
commit 5fda36b723
481 changed files with 84873 additions and 57 deletions
+26
View File
@@ -0,0 +1,26 @@
package objectstore
import (
"testing"
"github.com/aws/smithy-go"
"github.com/stretchr/testify/require"
"mtusi-messenger/internal/domain"
)
func TestMapObjectErrorBucketIsUnavailable(t *testing.T) {
err := mapObjectError("put object", "key", &smithy.GenericAPIError{
Code: "NoSuchBucket",
Message: "bucket is missing",
})
require.ErrorIs(t, err, domain.ErrUnavailable)
}
func TestMapObjectErrorMissingKeyIsNotFound(t *testing.T) {
err := mapObjectError("open object", "key", &smithy.GenericAPIError{
Code: "NoSuchKey",
Message: "object is missing",
})
require.ErrorIs(t, err, domain.ErrNotFound)
}