Skip to content
Myr

Add test for session cookiejars other than RequestsCookieJar

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

authored by Chase Sterling · committed by Chase Sterling · parent 8f3f4e2 · Browse files · 1 file+13 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+13 added−0 removed

  • other:+13 added−0 removed

1 file+13 added−0 removed

modified:test_requests.py+13 added
2 unmodified lines
34"""Tests for Requests."""56from __future__ import division7import cookielib8import json9import os10import unittest11import pickle1213import requests14from requests.auth import HTTPDigestAuth15from requests.compat import str16from requests.cookies import cookiejar_from_dict1718try:19 import StringIO20except ImportError:
117 unmodified lines
138 }139 )140 assert 'foo' not in s.cookies141142 def test_generic_cookiejar_works(self):143 cj = cookielib.CookieJar()144 cookiejar_from_dict({'foo': 'bar'}, cj)145 s = requests.session()146 s.cookies = cj147 r = s.get(httpbin('cookies'))148 # Make sure the cookie was sent149 assert r.json()['cookies']['foo'] == 'bar'150 # Make sure the session cj is still the custom one151 assert s.cookies is cj152153 def test_user_agent_transfers(self):154155 heads = {156 'User-agent': 'Mozilla/5.0 (github.com/kennethreitz/requests)'
300 unmodified lines