From 40038cc860cbacfd0512dcc7a50245494a07556e Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 26 Nov 2019 13:42:47 +0300 Subject: [PATCH] service: test coverage for CheckOwner --- service/verify_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/verify_test.go b/service/verify_test.go index 1403c678..237e3623 100644 --- a/service/verify_test.go +++ b/service/verify_test.go @@ -9,6 +9,7 @@ import ( "github.com/gogo/protobuf/proto" crypto "github.com/nspcc-dev/neofs-crypto" "github.com/nspcc-dev/neofs-crypto/test" + "github.com/nspcc-dev/neofs-proto/refs" "github.com/pkg/errors" "github.com/stretchr/testify/require" ) @@ -78,6 +79,12 @@ func TestMaintainableRequest(t *testing.T) { } } + { // Validate owner + user, err := refs.NewOwnerID(&owner.PublicKey) + require.NoError(t, err) + require.NoError(t, req.CheckOwner(user)) + } + { // Good case: require.NoError(t, VerifyRequestHeader(req))