Skip to content
Myr

Merge branch 'develop'

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 · parents 82e8fdb, d938f32 · Browse files · 4 files+43 added−5 removed
This commit

State

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

Diff stats

4 files+43 added−5 removed

  • other:+43 added−5 removed

4 files+43 added−5 removed

modified:requests/core.py+2 added-2 removed
10 unmodified lines
1112"""1314__title__ = 'requests'15__version__ = '0.6.5'16__build__ = 0x00060515__version__ = '0.6.6'16__build__ = 0x00060617__author__ = 'Kenneth Reitz'18__license__ = 'ISC'19__copyright__ = 'Copyright 2011 Kenneth Reitz'20
9 unmodified lines
modified:requests/sessions.py+4 added-2 removed
47 unmodified lines
4849class Session(object):50 """A Requests session."""5152 __attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks']52 __attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks', 'params']535455 def __init__(self,56 headers=None,57 cookies=None,58 auth=None,59 timeout=None,60 proxies=None,61 hooks=None):61 hooks=None,62 params=None):6364 self.headers = headers or {}65 self.cookies = cookies or {}66 self.auth = auth67 self.timeout = timeout68 self.proxies = proxies or {}69 self.hooks = hooks or {}70 self.params = params or {}7172 # Set up a CookieJar to be used by default73 self.cookies = cookielib.FileCookieJar()74
61 unmodified lines
modified:HISTORY.rst+9 added-1 removed
1History2-------340.6.5 (2011-10-19)40.6.6 (2011-10-19)5++++++++++++++++++67* Session parameter bugfix (params merging)89100.6.5 (2011-10-18)11++++++++++++++++++1213* Offline (fast) test suite.14* Session dictionary argument merging.1516
5 unmodified lines
22* Removal of ``r.read/close`` methods23* New ``r.faw`` interface for advanced response usage.*24* Automatic expansion of parameterized headers2526270.6.3 (2011-10-13)28++++++++++++++++++2930* Beautiful ``requests.async`` module, for making async requests w/ gevent.3132330.6.2 (2011-10-09)34++++++++++++++++++3536* GET/HEAD obeys allow_redirects=False
160 unmodified lines
modified:test_requests.py+28 added
466 unmodified lines
467468 self.assertEqual(r2.status_code, 200)469470471 def test_session_persistent_params(self):472473 params = {'a': 'a_test'}474475 s = Session()476 s.params = params477478 # Make 2 requests from Session object, should send header both times479 r1 = s.get(httpbin('get'))480 assert params['a'] in r1.content481482483 params2 = {'b': 'b_test'}484485 r2 = s.get(httpbin('get'), params=params2)486 assert params['a'] in r2.content487 assert params2['b'] in r2.content488489490 params3 = {'b': 'b_test', 'a': None, 'c': 'c_test'}491492 r3 = s.get(httpbin('get'), params=params3)493494 assert not params['a'] in r3.content495 assert params3['b'] in r3.content496 assert params3['c'] in r3.content497498499if __name__ == '__main__':500 unittest.main()