Commit Graph

312 Commits

Author SHA1 Message Date
Kevin Burke 7f236fcc40 woops 2014-08-24 20:22:55 -07:00
Kevin Burke 39b3a436d3 assert connect timeout inheritance 2014-08-24 20:18:05 -07:00
Kevin Burke c2aeaa3959 Add support for connect timeouts
Modifies the timeout interface to also accept a tuple (connect, read) which
would be used to set individual connect and read timeouts for Requests. Adds
Advanced documentation explaining the interface and providing guidance for
timeout values.
2014-08-23 15:12:29 -07:00
ContinuousFunction 2fc6e8a894 Update on Tracking Previous Requests
Modified the comment in sessions.py and rewrote the test in
test_requests.py
2014-08-19 10:51:26 -07:00
ContinuousFunction df641e74ff Tracking Previous Requests
Addresses the issue brought up here:
https://github.com/kennethreitz/requests/issues/1929
2014-08-17 19:13:26 -07:00
Josh Schneier 47d0517d66 handle urllib3 api changes; closes #2045 2014-07-29 23:29:21 -04:00
Roman Levin cf01a743af Replace setattr 2014-07-24 23:30:11 +02:00
Roman Levin 9eab9f7415 Handle socket errors in iter_content 2014-07-24 23:00:50 +02:00
Jeff Knupp bff65f42ee Update with style considerations by @kennethreitz 2014-06-10 11:16:24 -04:00
Jeff Knupp e2c4da7dd2 various pep-8 cleanups; remove unsused imports; remove unused variables 2014-06-10 09:09:33 -04:00
Cory Benfield d977ee8a24 Force basic auth strings to native string type 2014-06-08 10:20:32 +01:00
David Gouldin 32f600b083 Allow copying of PreparedRequests without headers/cookies 2014-05-30 10:11:53 -07:00
Martin Geisler c8916a08de test: restore Python 3.2 compatibility
The tests were broken because they used the u'...' Unicode literal
syntax which disappeared in Python 3.0 to 3.2.

We can work around this by conditionally defining a "u" function which
will produce a Unicode literal on Python 2.x. This is basically the
same approach as taken by the six library often used for writing
cross-version compatible code.
2014-05-26 16:20:39 +02:00
schlamar 16459910a9 Added test for redirect with wrong gzipped header. 2014-05-12 22:45:45 +02:00
schlamar 5e860c08d8 Added test case to handle response of streamed redirects.
Credits go to @zackw.
2014-05-12 22:45:45 +02:00
kennethreitz 569cd23c00 Merge pull request #1937 from jaraco/master
Improved decoding support for Response.iter_content and iter_lines
2014-05-12 15:04:35 -04:00
Feng Liu 24819e8aae support request tuple data
rewrite the TestModels

Ajust the code
2014-03-27 10:41:49 +08:00
Ian Cordasco b92f4ec6fb The expected value changes for the proxies keyword
It used to be None but a recent PR changed that before my last one was merged
2014-03-26 08:12:31 -05:00
kennethreitz b8128d6b1e Merge pull request #1962 from sigmavirus24/fix-history-type
Fix #1960: A Response's history should be a list
2014-03-24 11:45:06 -04:00
kennethreitz 5f48e4a120 Merge pull request #1963 from sigmavirus24/fix-redirect-methods
Fix #1955: Do not use original request in redirect
2014-03-24 11:44:14 -04:00
Ian Cordasco 8d693a2a27 Fix #1955: Do not use original request in redirect
The original request was never being properly overriden in resolve_redirects.
As such being having a POST request respond with a 303 would generate a GET
request. If the GET request encountered another redirect to something like a
307, then it would use the original request and generate another POST request.

There are two parts to this fix:

- The fix itself
- The test infrastructure to ensure it does not regress because HTTPBin is
  insufficient
2014-03-15 11:38:13 -05:00
Ian Cordasco daf56b3f62 Fix #1960: A Response's history should be a list 2014-03-15 10:33:00 -05:00
Cory Benfield 724038e4b5 Test stripping standard auth. 2014-03-12 21:53:07 +00:00
Jason R. Coombs 7b378cb742 Add tests for decode_unicode 2014-03-04 17:46:58 -05:00
kennethreitz d8557a2627 Merge pull request #1935 from cjstapleton/master
Add timeout to stream with testing
2014-03-03 13:14:37 -05:00
cjstapleton 5f404a0592 Fix styling issues with add timeout to stream with testing 2014-02-28 19:06:59 -06:00
cjstapleton 930f03c864 Add timeout to stream with testing
Fixes Issue #1803
2014-02-28 10:08:57 -06:00
Ian Cordasco d2f647cee4 Do not set headers with None value
- Regardless of whether they are on the session or not
- Fixes #1920
2014-02-14 16:15:21 -06:00
Zack Weinberg 0caa243212 New Response property, .is_redirect. 2014-02-13 14:27:42 -05:00
Konstantinos Koukopoulos b6e16799d0 test pyopenssl redirect (unit test for #1887) 2014-01-28 09:08:16 -08:00
Roberto Migli eb124353af Added comment for test test_get_auth_from_url 2014-01-13 16:29:46 +01:00
Roberto Migli 49fb630eb4 Merged changes from @lukasa 2014-01-13 14:04:28 +01:00
Roberto Migli a6a8342066 Fixed parsing of username and password encoded in the URI 2014-01-13 13:32:00 +01:00
Cory Benfield ca187abd13 Unquote the auth after splitting the url. 2014-01-11 09:59:23 +00:00
Konstantin Podshumok b8f1263f16 split cookiejar as dict test 2013-12-18 18:50:53 +04:00
Konstantin Podshumok e6a32d6283 preserve python2-like dict API for RequestCookieJar 2013-12-18 18:09:24 +04:00
Konstantin Podshumok 537def4a4f fix regression with cookiejar.iteritems() 2013-12-18 06:56:53 +04:00
Michael Becker 837ba94dde test_requests: convert tests to py.test style 2013-12-06 10:08:42 -05:00
Michael Becker ea4570da57 cookies: Fix bugs found during CI 2013-12-06 09:02:45 -05:00
Michael Becker ef5875cc19 cookies: Take a less cowardly approach
Per discussion with @sigmavirus24, we'll take the less cowardly approach here.
"the RFC defines the Expires header as a string with the format we're assigning to ``time_template`` so checking if it is a string is unnecessary."

Crossing my fingers that this doesn't break anyones existing code...
2013-12-06 09:02:45 -05:00
Michael Becker 39841562c5 test_requests: Add tests for morsel_to_cookie
These tests will ensure my changes to how we handle 'expires' don't cause any regressions.
2013-12-06 08:56:30 -05:00
kennethreitz ba3dab5047 Merge pull request #1770 from kmadac/master
Implemetation of IP address ranges for no_proxy environment variable
2013-12-05 14:40:44 -08:00
Kamil Madac 1d42d9d274 function is_ipv4_network renamed
more detailed check of cidr format
2013-12-05 11:15:52 +01:00
Kamil Madac 0d52ef7084 Additional tests added 2013-12-04 15:10:24 +01:00
Chase Sterling 5b30e960eb Add a test case for request cookies persisting to session. refs #1728 2013-12-04 06:35:16 -06:00
Kamil Madac 0a4e65c0ed Tests added 2013-12-04 10:54:36 +01:00
kennethreitz 4bceb312f1 Merge pull request #1768 from Lukasa/credpct
Unencode usernames and passwords taken from URLs.
2013-12-03 17:36:00 -08:00
kennethreitz a030a58303 Merge pull request #1766 from Lukasa/qop
Quote qop values in digest auth.
2013-12-03 17:33:59 -08:00
kennethreitz 5c915451e7 Merge pull request #1657 from sigmavirus24/fix-session-hooks
Honor session hooks
2013-12-03 17:33:42 -08:00
Kamil Madac 6131390345 Revert "Small test added"
This reverts commit f0d3edf409.
2013-12-03 16:41:07 +01:00