Skip to content
Snippets Groups Projects
Commit 633e8659 authored by Alena Petraki's avatar Alena Petraki
Browse files

Правки тестов

parent c5119696
No related tags found
No related merge requests found
...@@ -115,7 +115,7 @@ func (s *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionRe ...@@ -115,7 +115,7 @@ func (s *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionRe
return nil, errors.New("extension ID required") return nil, errors.New("extension ID required")
} }
svc, ok := s.extensions[in.Extension] svc, ok := s.extensions[ext]
if !ok { if !ok {
return nil, ErrUnknownExtension return nil, ErrUnknownExtension
} }
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"git.perx.ru/perxis/perxis-go/pkg/errors" "git.perx.ru/perxis/perxis-go/pkg/errors"
"git.perx.ru/perxis/perxis-go/pkg/operation" "git.perx.ru/perxis/perxis-go/pkg/operation"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
// не актуальные тесты // не актуальные тесты
...@@ -194,9 +195,11 @@ func TestServer_Action(t *testing.T) { ...@@ -194,9 +195,11 @@ func TestServer_Action(t *testing.T) {
srv := NewServer(operation.NewDefaultService(), tt.services) srv := NewServer(operation.NewDefaultService(), tt.services)
got, err := srv.Action(context.Background(), tt.in) got, err := srv.Action(context.Background(), tt.in)
if tt.wantErr != "" { if tt.wantErr != "" {
require.Error(t, err)
assert.EqualErrorf(t, err, tt.wantErr, fmt.Sprintf("Action(%v)", tt.in)) assert.EqualErrorf(t, err, tt.wantErr, fmt.Sprintf("Action(%v)", tt.in))
return return
} }
require.NoError(t, err)
assert.Equalf(t, tt.want, got, "Action(%v)", tt.in) assert.Equalf(t, tt.want, got, "Action(%v)", tt.in)
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment