deleted:tests/test_requests_async.py-77 removed
1-#!/usr/bin/env python2-# -*- coding: utf-8 -*-3-4-# Path hack.5-import sys, os6-sys.path.insert(0, os.path.abspath('..'))7-8-import sys9-import unittest10-11-import select12-has_poll = hasattr(select, "poll")13-14-from requests import async15-import requests16-17-sys.path.append('.')18-from test_requests import httpbin, RequestsTestSuite, SERVICES19-20-21-class RequestsTestSuiteUsingAsyncApi(RequestsTestSuite):22- """Requests async test cases."""23-24- def patched(f):25- """Automatically send request after creation."""26-27- def wrapped(*args, **kwargs):28-29- request = f(*args, **kwargs)30- return async.map([request])[0]31-32- return wrapped33-34- # Patched requests.api functions.35- global request36- request = patched(async.request)37-38- global delete, get, head, options, patch, post, put39- delete = patched(async.delete)40- get = patched(async.get)41- head = patched(async.head)42- options = patched(async.options)43- patch = patched(async.patch)44- post = patched(async.post)45- put = patched(async.put)46-47-48- def test_entry_points(self):49-50- async.request51-52- async.delete53- async.get54- async.head55- async.options56- async.patch57- async.post58- async.put59-60- async.map61- async.send62-63- def test_select_poll(self):64- """Test to make sure we don't overwrite the poll"""65- self.assertEqual(hasattr(select, "poll"), has_poll)66-67- def test_async_with_session_cookies(self):68- s = requests.Session(cookies={'initial': '42'})69- r1 = get(httpbin('cookies/set/async/yes'), session=s)70- r2 = get(httpbin('cookies/set/no_session/yes'))71- assert 'initial' in r1.cookies72- assert 'initial' not in r2.cookies and 'async' not in r2.cookies73- assert 'async' in s.cookies74- assert 'no_session' not in s.cookies75-76-if __name__ == '__main__':77- unittest.main()