Skip to content

Commit

Permalink
Add tests for RLP and rule mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Smolar committed Mar 4, 2024
1 parent 8015423 commit 2255799
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions testsuite/tests/kuadrant/limitador/route/test_route_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
@pytest.fixture(scope="module")
def rate_limit(rate_limit):
"""Add limit to the policy"""
selector = RouteSelector(RouteMatch(path=PathMatch(value="/anything", type=MatchType.PATH_PREFIX)))
selector = RouteSelector(
RouteMatch(path=PathMatch(value="/get", type=MatchType.PATH_PREFIX)),
RouteMatch(path=PathMatch(value="/anything/test", type=MatchType.PATH_PREFIX)),
)
rate_limit.add_limit("multiple", [Limit(5, 10)], route_selectors=[selector])
return rate_limit


def test_rule(client):
def test_rule_match(client):
"""Tests that RLP correctly applies to the given HTTPRoute rule"""
responses = client.get_many("/get", 5)
responses.assert_all(status_code=200)
Expand Down

0 comments on commit 2255799

Please sign in to comment.