Skip to content

Commit 7192ba5

Browse files
author
Petr Pchelko
committed
Replace assert.Equal with AssertProtoEqual for integration tests
1 parent bf549b3 commit 7192ba5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/integration/integration_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ func TestBasicConfigLegacy(t *testing.T) {
427427
response, err = c.ShouldRateLimit(
428428
context.Background(),
429429
common.NewRateLimitRequestLegacy("basic_legacy", [][][2]string{{{"key1", "foo"}}}, 1))
430-
assert.Equal(
430+
common.AssertProtoEqual(
431+
assert,
431432
&pb_legacy.RateLimitResponse{
432433
OverallCode: pb_legacy.RateLimitResponse_OK,
433434
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
@@ -451,7 +452,8 @@ func TestBasicConfigLegacy(t *testing.T) {
451452
limitRemaining = 0
452453
}
453454

454-
assert.Equal(
455+
common.AssertProtoEqual(
456+
assert,
455457
&pb_legacy.RateLimitResponse{
456458
OverallCode: status,
457459
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
@@ -479,7 +481,8 @@ func TestBasicConfigLegacy(t *testing.T) {
479481
limitRemaining2 = 0
480482
}
481483

482-
assert.Equal(
484+
common.AssertProtoEqual(
485+
assert,
483486
&pb_legacy.RateLimitResponse{
484487
OverallCode: status,
485488
Statuses: []*pb_legacy.RateLimitResponse_DescriptorStatus{
@@ -523,7 +526,8 @@ func testConfigReload(grpcPort, perSecond string, local_cache_size string) func(
523526
response, err := c.ShouldRateLimit(
524527
context.Background(),
525528
common.NewRateLimitRequest("reload", [][][2]string{{{getCacheKey("block", enable_local_cache), "foo"}}}, 1))
526-
assert.Equal(
529+
common.AssertProtoEqual(
530+
assert,
527531
&pb.RateLimitResponse{
528532
OverallCode: pb.RateLimitResponse_OK,
529533
Statuses: []*pb.RateLimitResponse_DescriptorStatus{{Code: pb.RateLimitResponse_OK}}},
@@ -577,7 +581,8 @@ func testConfigReload(grpcPort, perSecond string, local_cache_size string) func(
577581
response, err = c.ShouldRateLimit(
578582
context.Background(),
579583
common.NewRateLimitRequest("reload", [][][2]string{{{getCacheKey("key1", enable_local_cache), "foo"}}}, 1))
580-
assert.Equal(
584+
common.AssertProtoEqual(
585+
assert,
581586
&pb.RateLimitResponse{
582587
OverallCode: pb.RateLimitResponse_OK,
583588
Statuses: []*pb.RateLimitResponse_DescriptorStatus{

0 commit comments

Comments
 (0)