Skip to content
Myr

remove requests async tests

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 32327f8 · Browse files · 1 file+0 added−77 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+0 added−77 removed

  • tests:+0 added−77 removed

1 file+0 added−77 removed

deleted:tests/test_requests_async.py-77 removed
1#!/usr/bin/env python2# -*- coding: utf-8 -*-34# Path hack.5import sys, os6sys.path.insert(0, os.path.abspath('..'))78import sys9import unittest1011import select12has_poll = hasattr(select, "poll")1314from requests import async15import requests1617sys.path.append('.')18from test_requests import httpbin, RequestsTestSuite, SERVICES192021class RequestsTestSuiteUsingAsyncApi(RequestsTestSuite):22 """Requests async test cases."""2324 def patched(f):25 """Automatically send request after creation."""2627 def wrapped(*args, **kwargs):2829 request = f(*args, **kwargs)30 return async.map([request])[0]3132 return wrapped3334 # Patched requests.api functions.35 global request36 request = patched(async.request)3738 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)464748 def test_entry_points(self):4950 async.request5152 async.delete53 async.get54 async.head55 async.options56 async.patch57 async.post58 async.put5960 async.map61 async.send6263 def test_select_poll(self):64 """Test to make sure we don't overwrite the poll"""65 self.assertEqual(hasattr(select, "poll"), has_poll)6667 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.cookies7576if __name__ == '__main__':77 unittest.main()