summaryrefslogtreecommitdiff
path: root/test_requests.py
Commit message (Collapse)AuthorAgeFilesLines
* merge 2.0 insto masterKenneth Reitz2013-09-241-8/+41
|\
| * Allow non-string objects to be data with filesCory Benfield2013-08-171-0/+8
| |
| * Merge branch 'fix_401_cookies' of git://github.com/sigmavirus24/requests ↵Kenneth Reitz2013-07-311-1/+17
| |\ | | | | | | | | | into 2.0
| | * Fixed finally. Also requires updated httpbin.orgIan Cordasco2013-07-271-1/+1
| | |
| | * Start work on sending cookies backIan Ross and Ian Cordasco2013-07-271-0/+16
| | | | | | | | | | | | On 401's the cookies received aren't sent back to the server. See: #1336
| * | Merge branch 'keytype' of git://github.com/Lukasa/requests into 2.0Kenneth Reitz2013-07-311-7/+16
| |\ \
| | * | Modify new CID tests to use native string keys.Cory Benfield2013-07-291-4/+3
| | | |
| | * | Header keys should be native strings.Cory Benfield2013-07-291-3/+13
| | |/ | | | | | | | | | | | | This commit follows a discussion on IRC. For more information, see the Pull Request associated with it.
* | | Merge pull request #1503 from skastel/masterKenneth Reitz2013-09-241-0/+7
|\ \ \ | | | | | | | | Fixing error return to be consistent with tuple return at the end of the method
| * | | Fixing tests to verify thrown ValueError's.Stephen Huenneke2013-08-081-4/+5
| | | |
| * | | Raising ValueError's when we're passed inconsistent POST data and files dict.Stephen Huenneke2013-08-061-0/+6
| | |/ | |/|
* | | Improved content encoding detection.Jon Parise2013-09-031-0/+44
| |/ |/| | | | | | | | | | | | | | | | | | | | | get_encodings_from_content() can now detect HTML in-document content encoding declarations in the following formats: - HTML5 - HTML4 - XHTML 1.x served with text/html MIME type - XHTML 1.x served as XML Ref: http://www.w3.org/International/questions/qa-html-encoding-declarations
* | Merge pull request #1487 from ↵Kenneth Reitz2013-07-311-34/+15
|\ \ | | | | | | | | | | | | dpursehouse/rewrite-test_mixed_case_scheme_acceptable Rewrite test cases to remove dependency on httpbin.org and example.com
| * | Check the response URL in `test_uppercase_scheme_redirect`David Pursehouse2013-07-241-0/+1
| | | | | | | | | | | | | | | Update the test to check that the URL in the response is the one that we expect, i.e. the one it was supposed to redirect to.
| * | Rewrite `test_uppercase_scheme_redirect` to use local httpbinDavid Pursehouse2013-07-241-1/+3
| | | | | | | | | | | | | | | Instead of redirecting to hard-coded 'example.com', use the URL defined in `HTTPBIN_URL` with the path set to the 'html' endpoint.
| * | Remove redundant test case `test_uppercase_scheme`David Pursehouse2013-07-241-4/+0
| | | | | | | | | | | | | | | This test verifies that an upper case scheme ('HTTP') works correctly, but this is already tested in `test_mixed_case_scheme_acceptable`.
| * | Rewrite `test_mixed_case_scheme_acceptable` to work with local httpbinDavid Pursehouse2013-07-241-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using hard-coded urls to httpbin.org, use the url defined in `HTTPBIN_URL` replacing the scheme as necessary to test the mixed cases. Refs #1485
| * | Remove redundant session in `test_mixed_case_scheme_acceptable`David Pursehouse2013-07-241-4/+1
| |/
* | Merge settings when creating PreparedRequest, don't copy Request.Robert Estelle2013-07-311-31/+0
| |
* | Add Session.prepare_request test case.Robert Estelle2013-07-301-0/+17
| |
* | Add Request.copy() test case.Robert Estelle2013-07-301-0/+31
|/
* Derp. Use compatIan Cordasco2013-07-231-3/+2
|
* Use urlparse.urljointo construct httpbin urlIan Cordasco2013-07-231-1/+2
|
* Merge pull request #1482 from dpursehouse/fix-testcases-with-proxyKenneth Reitz2013-07-231-1/+7
|\ | | | | Fix test cases that fail when running behind a proxy
| * Fix test cases that fail when running behind a proxyDavid Pursehouse2013-07-231-1/+7
| | | | | | | | | | | | | | | | | | When sending a request via `Session.send()` the proxies must be explicitly given with the `proxies` argument. This is not done in the test cases, which means that they fail when run on a system that is behind a proxy. Update test cases to make sure the proxies are set in the sessions.
* | Test cases fail when `HTTPBIN_URL` does not have trailing slashDavid Pursehouse2013-07-231-0/+2
|/ | | | | | | | Test cases can be run against a local httpbin server defined by the `HTTPBIN_URL` environment variable, but it causes tests to fail if the given URL does not end with a slash. Ensure that the URL always ends with a slash.
* Merge pull request #1440 from fcurella/patch-0Kenneth Reitz2013-07-151-0/+5
|\ | | | | unquote double-quotes cookie values
| * keep the double quotes, but don't escape themFlavio Curella2013-07-011-1/+1
| |
| * unquote double-quotes cookie valuesFlavio Curella2013-07-011-0/+5
| |
* | Add test to verify .netrc authentication behavior.Vikram Oberoi2013-06-271-0/+28
|/ | | | | | | Here's what should happen: - If no credentials are given, use netrc if there's a netrc entry. - If credentials are given, they should override netrc.
* Don't reuse PreparedRequest on redirectsRoman Haritonov2013-06-081-1/+0
|
* new failing test_requests_in_history_are_not_overridden()Roman Haritonov2013-06-081-1/+8
|
* Merge pull request #1334 from rcarz/masterKenneth Reitz2013-06-081-0/+8
|\ | | | | resolve_redirects no longer throws an InvalidSchema exception when the scheme is uppercase
| * rebased with upstream/masterBob Carroll2013-05-261-0/+2
| |
| * this didn't merge properlyBob Carroll2013-05-261-5/+3
| |
| * added assertion to test_uppercase_scheme_redirect for the response codeBob Carroll2013-05-261-1/+1
| |
| * resolve_redirects now checks for a scheme before converting the scheme to ↵Bob Carroll2013-05-261-0/+8
| | | | | | | | lowercase, added tests or the scheme casing
* | added tests for mixed-case scheme URLs, changed adapters passing down URLs ↵Viktor Haag2013-05-241-6/+13
| | | | | | | | into urllib3 by lower-ifying them so that the underlying pool manager can effectively pool by scheme as dictionary key
* | - fixed func call syntax on lower to lower()Viktor Haag2013-05-241-0/+21
|/ | | | - added test cases for trying to test GETS on mixed-case schemas
* Fix #1374papaeye2013-05-221-1/+2
|
* Fix typo, %t -> %rpapaeye2013-05-221-1/+3
|
* Only pass unicode fieldnames to urllib3.Ib Lundgren2013-05-211-0/+10
|
* Refactor merge_kwargs for clarity and to fix a few bugsChase Sterling2013-05-201-0/+14
|
* Fix for #1362.Dave Shawley2013-05-161-0/+9
| | | | | | | | | | | | | `PreparedRequest.prepare_url` incorrectly applied IDNA encoding to the URLs entire `netloc`. It should only be encoding the hostname portion of the URL. IDNA encoding was limiting the user info, host, and port segments to be a maximum of 63 characters which causes problems for all by the most trivial user + password combinations. - Replaced usage of `urlparse` in `PreparedRequest.prepare_url` with `urllib3` equivalent. - Modified IDNA encoding section so that it only encodes the host portion of the URL.
* Fixes #1320: transport adapters stored in ordered formŁukasz Langa2013-05-151-1/+39
|
* Minor update to tests, added docstringsColin Dunklau2013-05-011-0/+9
| | | | Requested by @sigmavirus24.
* Rewrite CaseInsensitiveDict to work correctly/sanelyColin Dunklau2013-04-301-0/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #649 and #1329 by making Session.headers a CaseInsensitiveDict, and fixing the implementation of CID. Credit for the brilliant idea to map `lowercased_key -> (cased_key, mapped_value)` goes to @gazpachoking, thanks a bunch. Changes from original implementation of CaseInsensitiveDict: 1. CID is rewritten as a subclass of `collections.MutableMapping`. 2. CID remembers the case of the last-set key, but `__setitem__` and `__delitem__` will handle keys without respect to case. 3. CID returns the key case as remembered for the `keys`, `items`, and `__iter__` methods. 4. Query operations (`__getitem__` and `__contains__`) are done in a case-insensitive manner: `cid['foo']` and `cid['FOO']` will return the same value. 5. The constructor as well as `update` and `__eq__` have undefined behavior when given multiple keys that have the same `lower()`. 6. The new method `lower_items` is like `iteritems`, but keys are all lowercased. 7. CID raises `KeyError` for `__getitem__` as normal dicts do. The old implementation returned 6. The `__repr__` now makes it obvious that it's not a normal dict. See PR #1333 for the discussions that lead up to this implementation
* Add another session cookie testChase Sterling2013-04-251-0/+8
|
* Fix cookielib importChase Sterling2013-04-251-2/+1
|
* Add test for session cookiejars other than RequestsCookieJarChase Sterling2013-04-251-0/+13
|