Skip to content
Myr

Added test for overriding Content-Length.

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

authored by Alexander Nelzin · committed by Alexander Nelzin · parent 431282e · Browse files · 1 file+8 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+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:test_requests.py+8 added
101 unmodified lines
102 assert 'Content-Length' not in get_req.headers103 head_req = requests.Request('HEAD', httpbin('head')).prepare()104 assert 'Content-Length' not in head_req.headers105106 def test_override_content_length(self):107 headers = {108 'Content-Length': 'not zero'109 }110 r = requests.Request('POST', httpbin('post'), headers=headers).prepare()111 assert 'Content-Length' in r.headers112 assert r.headers['Content-Length'] == 'not zero'113114 def test_path_is_not_double_encoded(self):115 request = requests.Request('GET', "http://0.0.0.0/get/test case").prepare()116117 assert request.path_url == '/get/test%20case'
1416 unmodified lines