Skip to content

Commit

Permalink
Fix path quoting benchmarks to use the same quoting config as product…
Browse files Browse the repository at this point in the history
…ion (#1294)
  • Loading branch information
bdraco authored Oct 16, 2024
1 parent 2395cb8 commit 976f540
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_quoting_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
QUOTER = _Quoter()
UNQUOTER = _Unquoter()
QUERY_QUOTER = _Quoter(safe="?/:@", protected="=+&;", qs=True, requote=False)
PATH_QUOTER = _Quoter(safe="@:", protected="/+", requote=False)

LONG_PATH = "/path/to" * 100
LONG_QUERY = "a=1&b=2&c=3&d=4&e=5&f=6&g=7&h=8&i=9&j=0" * 25
Expand All @@ -32,7 +33,7 @@ def test_quote_long_path(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUOTER(LONG_PATH)
PATH_QUOTER(LONG_PATH)


def test_quoter_pct(benchmark: BenchmarkFixture) -> None:
Expand Down Expand Up @@ -60,7 +61,7 @@ def test_quoter_quote_utf8(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUOTER("/шлях/файл")
PATH_QUOTER("/шлях/файл")


def test_unquoter_short(benchmark: BenchmarkFixture) -> None:
Expand Down

0 comments on commit 976f540

Please sign in to comment.