From 636b1f0cb819f63d37da1b9e5b21a70901b58fbf Mon Sep 17 00:00:00 2001 From: phala Date: Wed, 29 May 2024 08:40:51 +0200 Subject: [PATCH] Add RateLimitPolicy to affected_by test --- .../gateway/reconciliation/test_affected_by.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testsuite/tests/kuadrant/gateway/reconciliation/test_affected_by.py b/testsuite/tests/kuadrant/gateway/reconciliation/test_affected_by.py index 339cd887..11daa0db 100644 --- a/testsuite/tests/kuadrant/gateway/reconciliation/test_affected_by.py +++ b/testsuite/tests/kuadrant/gateway/reconciliation/test_affected_by.py @@ -2,9 +2,22 @@ import pytest +from testsuite.policy.rate_limit_policy import RateLimitPolicy, Limit + pytestmark = [pytest.mark.kuadrant_only] +@pytest.fixture(scope="module") +def rate_limit(openshift, blame, module_label, route): + """ + Rate limit object. + """ + + policy = RateLimitPolicy.create_instance(openshift, blame("limit"), route, labels={"testRun": module_label}) + policy.add_limit("basic", [Limit(5, 10)]) + return policy + + def test_route_status(route, rate_limit, authorization): """Tests affected by status for HTTPRoute""" route.refresh()