Commit Graph

410 Commits

Author SHA1 Message Date
Kenneth Reitz aa08f33f98 Merge pull request #884 from everbird/develop
Support CJK parameters when post files
2012-10-17 07:21:39 -07:00
Stephen Zhuang bb9e72885a For the uniformity :) 2012-10-09 23:19:42 +08:00
Radu Voicilas 820dfb0495 Making the code more PEP8 compliant 2012-10-09 00:42:49 +03:00
Ian Cordasco 4e6cf21d82 Only register callable items in lists
Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
2012-10-09 00:42:49 +03:00
Stephen Zhuang 86b39bf3e3 Support CJK parameters when post files 2012-10-08 16:52:06 +08:00
Ian Cordasco 77677eb71d Only register callable items in lists
Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
2012-10-01 14:05:27 -04:00
Ian Cordasco 4dd3d1a1a2 Fix #785 & add regression test. 2012-09-20 11:45:03 -04:00
Eric Hansen 2dc7db4730 Fixed issue with empty proxies being passed 2012-09-11 15:40:16 -04:00
Shivaram Lingamneni c73646da00 fix some tests to correctly cover the API
After #831, the tests added in #764 (which relied on iter_content()
crashing if the response was prefetched) no longer tested what they
were intended to test.
2012-09-06 16:31:01 -07:00
Shivaram Lingamneni 77cf995165 permissive implementation of iter_content
This allows iter_content and iter_lines to succeed without
crashing even after the response content has been fetched
(iter_content gives you an iterator over the prefetched
content)
2012-09-02 01:42:30 -07:00
Kenneth Reitz 088454b145 Merge pull request #805 from Lukasa/develop
Remove None values from post data.
2012-08-25 07:35:06 -07:00
Rhys Elsmore 217a9d50cd Removed Duplicate Import 2012-08-23 16:18:47 +10:00
Cory Benfield b781acc7ab Add a failing test for Issue #378. 2012-08-22 22:33:20 +01:00
Kenneth Reitz 385217e55c Merge pull request #789 from zigmonty/http_digest_fixes
HTTPDigestAuth fixes
2012-08-18 17:42:40 -07:00
Kenneth Reitz 95493917f2 Merge pull request #791 from sigmavirus24/key_val_lists
Key val lists
2012-08-18 15:54:49 -07:00
Ian Cordasco a5d462e176 Revert "Some pyflakes fixes."
This reverts commit c71f48b5f1.

To please his BDFLness @kennethreitz ;)
2012-08-18 18:31:58 -04:00
Cory Benfield a04775f862 Typo fix in tests. 2012-08-18 21:24:02 +01:00
Ian Cordasco ab56e4a9f1 Fix python3 tests.
I wasn't thorough enough with how I dealt with headers. Most of the header
logic in the Request object utilizes dictionary properties which will not work
with a key/value list.

I'll dig more into this, but I know the rest of the features are more
important so I'll take my time on this and send a separate pull request.
2012-08-18 14:41:13 -04:00
Ian Cordasco f01694e274 All tests pass, time for a PR. 2012-08-18 13:47:14 -04:00
Ian Cordasco e02da89337 Merge branch 'develop' into key_val_lists
Conflicts:
	requests/models.py
	tests/test_requests.py

Remove some of Lukasa's duplication of my efforts in _encode_data.
2012-08-18 12:15:03 -04:00
Peter Montagner 6d02036092 Extend digests test case to connect twice using the same auth and confirm the second one went direct. 2012-08-18 15:33:05 +10:00
Locker537 42d0a2169e Whitespace fixes following PEP8. 2012-08-16 17:38:35 -04:00
Cory Benfield e08b853a0c Test for throwing useful exception on bad label. 2012-08-13 21:18:56 +01:00
Jakub Roztocil 88c762e256 Fixed tests for Python 3 (text vs. bytes). 2012-08-11 08:19:35 +02:00
Jakub Roztocil dee3693ea0 Use BytesIO for bytes.
This fixes a TypeError on Python 3 that ocurred when passing
bytes as the values for files.
2012-08-10 19:49:03 +02:00
Jakub Roztocil cfa627ae62 Fixed encoding of fields with the same name.
* Properly handle repeated data fields for multipart/form-data requests (#737)
* Allow a list of 2-tuples as the `files` agument.
* Consistently serialize lists a of parameters (#729).
2012-08-10 19:49:03 +02:00
Radomir Stevanovic 4da4792844 tests: python2.6 compat (assertIn added in 2.7) 2012-08-10 17:51:01 +02:00
Kenneth Reitz a65e8b4a22 Merge pull request #767 from stefanp/develop
Wrap socket.error in ConnectionError (+ unit tests)
2012-08-08 13:23:10 -07:00
Stefan Praszalowicz 875c9e18ab Wrap socket.error in ConnectionError (+ unit tests) 2012-08-08 11:12:32 -07:00
Cory Benfield e624ae8aea Add test for Issue #423. 2012-08-08 13:33:25 +01:00
Ian Cordasco ceec572cb9 Merge branch 'develop' into key_val_lists
Conflicts:
    requests/models.py
2012-08-07 12:11:15 -04:00
Shivaram Lingamneni 291859c199 fix the tests for python 3 2012-08-06 16:11:45 -07:00
Shivaram Lingamneni 857d8eda3a red tests derived from @dhagrow's examples in #760 2012-08-06 15:53:48 -07:00
Kenneth Reitz b13c24d7b9 Merge pull request #760 from slingamn/fix_leak.release
address connection leak issue from #520
2012-08-05 21:38:12 -07:00
Shivaram Lingamneni 3c0b94047c address connection leak issue from #520
* prefetch now defaults to True, ensuring that by default, sockets
  are returned to the urllib3 connection pool on request end
* sessions now have a close() method, notifying urllib3 to close pooled
  connections
* the module-level API, e.g., `requests.get('http://www.google.com')`,
  explicitly closes its session when finished

When prefetch is False, the open socket becomes part of the state of the
Response object, and it's the client's responsibility to read the whole
body, at which point the socket will be returned to the pool.
2012-08-05 21:09:13 -07:00
Ian Cordasco d82d124152 Merge branch 'develop' into key_val_lists 2012-08-05 16:59:24 -04:00
Marcus McCurdy 493ea93469 Fixed issue #747
Bound the name builtin_str to __builtin__.str and added another check
for this class since the str class was rebound to unicode in compat.
This issue was only for Python 2 as well.
2012-08-03 23:13:17 -04:00
Ian Cordasco 2d5e38f30a params now accepts a k/v list.
Also added test for params accepting k/v lists.
2012-08-03 22:24:52 -04:00
Marcus McCurdy 12328d6e58 Added a test to expose issue #747 2012-08-03 20:09:56 -04:00
Ian Cordasco 5ff165a1e2 Better handling of invalid files.
I stole the idea from _encode_params in all candor.
2012-08-02 17:31:30 -04:00
Ian Cordasco c71f48b5f1 Some pyflakes fixes.
They were just bothering me far too much with vim+syntastic.
2012-08-02 17:31:30 -04:00
Ian Cordasco 2b33bc289f Tests written for _encode_files new capability.
Work on issue #179
2012-08-02 17:31:30 -04:00
Cory Benfield 02dcc40acd Failing test for Issue #737. 2012-07-27 09:49:39 +01:00
Kenneth Reitz 82d343fa00 disable tricky tests 2012-07-27 02:18:31 -04:00
Matthias Rahlf 08cebb3c2f fixed param handling in Request.full_url 2012-07-10 01:06:02 +02:00
Cory Benfield f8076fee5e Temporary fix for unicode literal breaking test. 2012-06-19 18:36:35 +01:00
Piotr Dobrogost 8d75cdf7fe Fixes issue #669
NamedTemporaryFile was being automatically deleted on Windows thus
couldn't be opened later for reading
2012-06-10 15:27:54 +02:00
Kenneth Reitz 10d2398173 fix test for python3 2012-06-07 22:21:06 -04:00
Kenneth Reitz 78eecd7d7e Merge pull request #659 from Bluehorn/develop
Allow passing a file or file-like object as data.
2012-06-07 19:06:49 -07:00
Kenneth Reitz e8f3fc33bb test that empty body text responses work 2012-06-07 21:54:45 -04:00