Skip to content
Myr

Test async requests with Session cookies

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

authored by Roman Haritonov · committed by Roman Haritonov · parent 56ef079 · Browse files · 1 file+10 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+10 added−0 removed

  • tests:+10 added−0 removed

1 file+10 added−0 removed

modified:tests/test_requests_async.py+10 added
10 unmodified lines
11import select12has_poll = hasattr(select, "poll")1314from requests import async15import requests1617sys.path.append('.')18from test_requests import httpbin, RequestsTestSuite, SERVICES19
43 unmodified lines
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)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()