Skip to content
Myr

Added test cases for URI cleaning in the query part (Issue #429).

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Matt Giuca · committed by Matt Giuca · parent 9e2f5dd · Browse files · 1 file+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+23 added−0 removed

  • other:+23 added−0 removed

1 file+23 added−0 removed

modified:test_requests.py+23 added
158 unmodified lines
159 url = httpbin('get/' + path_unreserved_escaped)160 response = get(url)161 self.assertEqual(response.url, httpbin('get/' + path_unreserved))162163 # Re-run all of the same tests on the query part of the URI164 query_fully_escaped = '%3Ca%25b%23c%2Fd%3E=%C3%98%20%C3%A5'165 url = httpbin('get/?' + query_fully_escaped)166 response = get(url)167 self.assertEqual(response.url, httpbin('get/?' + query_fully_escaped))168169 query = u'<a%25b%23c%2Fd%3E=\u00d8 %C3%A5'170 url = httpbin('get/?' + query)171 response = get(url)172 self.assertEqual(response.url, httpbin('get/?' + query_fully_escaped))173174 # The legal characters in query happens to be the same as in path175 query_reserved = '!$&\'()*+,/:=@-._~'176 url = httpbin('get/?' + query_reserved)177 response = get(url)178 self.assertEqual(response.url, httpbin('get/?' + query_reserved))179180 query_unreserved = 'ABCDwxyz=1234-._~'181 query_unreserved_escaped = '%41%42%43%44%77%78%79%7A=%31%32%33%34%2D%2E%5F%7E'182 url = httpbin('get/?' + query_unreserved_escaped)183 response = get(url)184 self.assertEqual(response.url, httpbin('get/?' + query_unreserved))185186187 def test_user_agent_transfers(self):188 """Issue XX"""189190 heads = {
613 unmodified lines