Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
633e8659
Commit
633e8659
authored
1 year ago
by
Alena Petraki
Browse files
Options
Downloads
Patches
Plain Diff
Правки тестов
parent
c5119696
Branches
feature/PRXS-1891-ServiceLogMiddleware
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/extension/server.go
+1
-1
1 addition, 1 deletion
pkg/extension/server.go
pkg/extension/server_test.go
+3
-0
3 additions, 0 deletions
pkg/extension/server_test.go
with
4 additions
and
1 deletion
pkg/extension/server.go
+
1
−
1
View file @
633e8659
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
pkg/extension/server_test.go
+
3
−
0
View file @
633e8659
...
@@ -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
)
})
})
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment