Skip to content

Commit

Permalink
Test to reproduce twisted/klein#339
Browse files Browse the repository at this point in the history
See #311.
  • Loading branch information
twm committed Dec 23, 2020
1 parent 39c37f9 commit f89c5c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/treq/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ def test_request_uri_bytes_pass(self):
None,
)

def test_request_uri_plus_pass(self):
"""
URL parameters may contain spaces encoded as ``+``. These remain as
such and are not mangled.
This reproduces `Klein #339 <https://github.com/twisted/klein/issues/339>`_.
"""
self.client.request(
"GET",
"https://example.com/?foo+bar=baz+biff",
)
self.agent.request.assert_called_once_with(
b'GET',
b"https://example.com/?foo+bar=baz+biff",
Headers({b'accept-encoding': [b'gzip']}),
None,
)

def test_request_uri_idn_params(self):
"""
A URL that contains non-ASCII characters can be augmented with
Expand Down

0 comments on commit f89c5c8

Please sign in to comment.