Skip to content

Commit

Permalink
client: Return error from unimplemented test methods
Browse files Browse the repository at this point in the history
Nil response without an error can lead to the undesired behavior. Since
other methods are not expected to be called, unimplemented error fits
the best.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Nov 19, 2024
1 parent bdfaa0e commit 843085c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/netmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type serverNetMap struct {
}

func (x *serverNetMap) createSession(context.Context, session.CreateRequest) (*session.CreateResponse, error) {
return nil, nil
return nil, errors.New("unimplemented")
}

func (x *serverNetMap) netMapSnapshot(_ context.Context, req v2netmap.SnapshotRequest) (*v2netmap.SnapshotResponse, error) {
Expand Down
3 changes: 2 additions & 1 deletion client/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package client

import (
"context"
"errors"
"testing"

v2netmap "github.com/nspcc-dev/neofs-api-go/v2/netmap"
Expand All @@ -17,7 +18,7 @@ type sessionAPIServer struct {
}

func (m sessionAPIServer) netMapSnapshot(context.Context, v2netmap.SnapshotRequest) (*v2netmap.SnapshotResponse, error) {
return nil, nil
return nil, errors.New("unimplemented")
}

func (m sessionAPIServer) createSession(context.Context, session.CreateRequest) (*session.CreateResponse, error) {
Expand Down

0 comments on commit 843085c

Please sign in to comment.