Files
mtusi2026lab7/internal/platform/objectstore/s3_test.go
T
Vladislav Kunetskiy 1b6e96ccc0
Application / Go invariants and static checks (pull_request) Canceled after 0s
Application / Lab7 verified TLS and retained features (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
2026-11-10 14:39:57 +03:00

27 lines
627 B
Go

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)
}