Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Plotka <[email protected]>
  • Loading branch information
bwplotka committed Aug 6, 2021
1 parent 764205a commit cee3c63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions interceptors/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type mockReportable struct {

// Equal replaces require.Equal as google.golang.org/grpc/status errors are not easily comparable.
func (m *mockReportable) Equal(t *testing.T, expected []*mockReport) {
t.Helper()

require.Len(t, expected, len(m.reports))
for i, e := range m.reports {
require.Equal(t, expected[i].Typ, e.Typ, "%v", i)
Expand Down Expand Up @@ -263,7 +265,7 @@ func (s *ClientInterceptorTestSuite) TestListReporting() {

s.mock.Equal(s.T(), []*mockReport{{
CallMeta: CallMeta{Typ: ServerStream, Service: testpb.TestServiceFullName, Method: "PingList"},
postCalls: []error{io.EOF},
postCalls: []error{nil},
postMsgReceives: append(make([]error, testpb.ListResponseCount), io.EOF),
postMsgSends: []error{nil},
}})
Expand Down Expand Up @@ -330,7 +332,7 @@ func (s *ClientInterceptorTestSuite) TestBiStreamingReporting() {
require.EqualValues(s.T(), 100, count, "Number of received msg on the wire must match")
s.mock.Equal(s.T(), []*mockReport{{
CallMeta: CallMeta{Typ: BidiStream, Service: testpb.TestServiceFullName, Method: "PingStream"},
postCalls: []error{io.EOF},
postCalls: []error{nil},
postMsgReceives: append(make([]error, 100), io.EOF),
postMsgSends: make([]error, 100),
}})
Expand Down

0 comments on commit cee3c63

Please sign in to comment.