Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-vl committed May 18, 2021
1 parent 8fb97f3 commit d10adac
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/redis-gears_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,27 @@ func TestRgPyexecute(t *testing.T) {
require.NoError(t, resp.Error)
})

/**
* Unexpected Type Error
*/
t.Run("should handle unexpected type error", func(t *testing.T) {
t.Parallel()

// Client
client := testClient{
rcv: 0,
batchRcv: nil,
err: nil,
}

// Response
resp := queryRgPyexecute(queryModel{Command: models.GearsPyExecute, Key: "GB().run()"}, &client)
require.Len(t, resp.Frames, 2)
require.Len(t, resp.Frames[0].Fields, 1)
require.Equal(t, 0, resp.Frames[0].Fields[0].Len())
require.Equal(t, 0, resp.Frames[1].Fields[0].Len())
})

/**
* Error
*/
Expand Down

0 comments on commit d10adac

Please sign in to comment.