Skip to content

Commit

Permalink
Replace assert.Equal with AssertProtoEqual for integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Pchelko <[email protected]>
  • Loading branch information
Pchelolo committed Jul 14, 2020
1 parent bf549b3 commit 9f2cbf7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ func TestBasicConfigLegacy(t *testing.T) {
response, err = c.ShouldRateLimit(
context.Background(),
common.NewRateLimitRequestLegacy("basic_legacy", [][][2]string{{{"key1", "foo"}}}, 1))
assert.Equal(
common.AssertProtoEqual(
assert,
&pb_legacy.RateLimitResponse{
OverallCode: pb_legacy.RateLimitResponse_OK,
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
Expand All @@ -451,7 +452,8 @@ func TestBasicConfigLegacy(t *testing.T) {
limitRemaining = 0
}

assert.Equal(
common.AssertProtoEqual(
assert,
&pb_legacy.RateLimitResponse{
OverallCode: status,
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
Expand Down Expand Up @@ -479,7 +481,8 @@ func TestBasicConfigLegacy(t *testing.T) {
limitRemaining2 = 0
}

assert.Equal(
common.AssertProtoEqual(
assert,
&pb_legacy.RateLimitResponse{
OverallCode: status,
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
Expand Down Expand Up @@ -523,7 +526,8 @@ func testConfigReload(grpcPort, perSecond string, local_cache_size string) func(
response, err := c.ShouldRateLimit(
context.Background(),
common.NewRateLimitRequest("reload", [][][2]string{{{getCacheKey("block", enable_local_cache), "foo"}}}, 1))
assert.Equal(
common.AssertProtoEqual(
assert,
&pb.RateLimitResponse{
OverallCode: pb.RateLimitResponse_OK,
Statuses: []*pb.RateLimitResponse_DescriptorStatus{{Code: pb.RateLimitResponse_OK}}},
Expand Down Expand Up @@ -577,7 +581,8 @@ func testConfigReload(grpcPort, perSecond string, local_cache_size string) func(
response, err = c.ShouldRateLimit(
context.Background(),
common.NewRateLimitRequest("reload", [][][2]string{{{getCacheKey("key1", enable_local_cache), "foo"}}}, 1))
assert.Equal(
common.AssertProtoEqual(
assert,
&pb.RateLimitResponse{
OverallCode: pb.RateLimitResponse_OK,
Statuses: []*pb.RateLimitResponse_DescriptorStatus{
Expand Down

0 comments on commit 9f2cbf7

Please sign in to comment.