mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Moved test_chunked_upload to test_requests.py
This commit is contained in:
@@ -157,23 +157,6 @@ class TestContentEncodingDetection:
|
||||
'''.strip()
|
||||
assert get_encodings_from_content(content) == ['HTML5', 'HTML4', 'XML']
|
||||
|
||||
def test_chunked_upload(self):
|
||||
"""can safely send generators"""
|
||||
block_server = threading.Event()
|
||||
server = Server.basic_response_server(wait_to_close_event=block_server)
|
||||
data = (i for i in [b'a', b'b', b'c'])
|
||||
|
||||
with server as (host, port):
|
||||
url = 'http://{0}:{1}/'.format(host, port)
|
||||
r = requests.post(url, data=data, stream=True)
|
||||
block_server.set() # release server block
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.request.headers['Transfer-Encoding'] == 'chunked'
|
||||
|
||||
|
||||
|
||||
|
||||
USER = PASSWORD = "%!*'();:@&=+$,/?#[] "
|
||||
ENCODED_USER = compat.quote(USER, '')
|
||||
ENCODED_PASSWORD = compat.quote(PASSWORD, '')
|
||||
|
||||
Reference in New Issue
Block a user