lab4: исправления по ревью

This commit is contained in:
Vladislav Kunetskiy
2026-10-21 23:25:11 +03:00
parent 3389c6c900
commit e9f0fde6f2
32 changed files with 451 additions and 131 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)
}