This commit is contained in:
2026-10-03 13:22:11 +07:00
parent 05090722a0
commit 2caa2c1a88
74 changed files with 44 additions and 676 deletions
-3
View File
@@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/status"
)
// fakeStorage — in-memory реализация IFileStorage для app-слоя.
type fakeStorage struct {
files map[string]*file_storage.File
putErr error
@@ -90,7 +89,6 @@ func TestUploadFilePermissionDenied(t *testing.T) {
func TestUploadFileValidationInvalidArgument(t *testing.T) {
s := newTestFileServer(nil, 1<<20)
// Имя без расширения.
_, err := s.UploadFile(ctxWithClaims("author"), &proto.UploadFileReq{Filename: "clue", Data: pdfData(16)})
if status.Code(err) != codes.InvalidArgument {
t.Errorf("code = %v, want InvalidArgument", status.Code(err))
@@ -133,7 +131,6 @@ func TestUploadFileSuccess(t *testing.T) {
}
}
// mockServerTransportStream — заглушка для grpc.SetHeader в юнит-тестах.
type mockServerTransportStream struct {
grpc.ServerTransportStream
header metadata.MD