Hugo
6156271c48
Automatic formatters supported in Python 2.7+
2018-01-15 09:54:11 +02:00
Kevin McCarthy
88bf8f0aac
proxy getattr to the real connection too
2017-05-27 15:40:42 -10:00
Thomas Grainger
73dbc6f8cb
add missing _get_content_length static method
...
also add _is_textIO
2017-04-04 10:32:17 +01:00
Derek Bekoe
97473bb8d8
Correctly patch HTTPConnection.request in Python 3.6
...
Fixes https://github.com/kevin1024/vcrpy/issues/293
2017-01-23 14:54:26 -08:00
Charly
e5d6327de9
added a fix to httplib2
2017-01-11 17:54:15 -10:00
Jayson Reis
7cc513e1d2
Avoid concatenating bytes with strings
2016-01-19 14:19:03 +01:00
John Vandenberg
dc9cd4229b
Fix pyflakes and pep8 errors
...
Use extra asserts to use previously unused variables in tests,
such as `cass` and `response`.
Fix only pyflakes errors in docs/conf.py
2015-11-26 08:25:06 +11:00
Ivan Malison
f6b8e4f8e7
Lint cleanup
2015-10-25 20:30:33 -07:00
Tye Wang
ac510097e0
Add TODO and elaborate on comment
2015-09-18 12:19:17 -04:00
Tye Wang
79ff59feae
Attributes set on VCRConnection now also get set on the real_connection
2015-09-03 14:35:28 -04:00
Aron Griffis
7312229aef
Add HeadersDict, and mark add_header deprecated.
...
HeadersDict is a subclass of CaseInsensitiveDict with two new features:
1. Preserve the case of the header key from the first time it was set.
This means that later munging won't modify the key case. (You can
force picking up the new case with `del` followed by setting.)
2. If the value is a list or tuple, unpack it and store the first
element. This is the same as how `Request.add_header()` used to work.
For backward compatibility this commit preserves `Request.add_header()` but
marks it deprecated.
2015-08-25 06:30:50 -04:00
Antoine Bertin
6cbc0fb279
Fix httplib endheaders if a message_body exists
...
Fixes #140
2015-06-09 00:59:43 -07:00
Kevin McCarthy
4ade547779
python3 uses capital headers sometimes, let's do a case-agnostic header removal
2015-05-05 21:59:48 -10:00
Kevin McCarthy
5b9b6cd8b5
dont try to load chunked responses from cassettes, we already unchunked everything
2015-05-05 21:32:32 -10:00
Ivan Malison
870ab276c4
Possible fix for #140 .
2015-03-25 13:01:55 -07:00
Abhinav Gupta
2473bdb77a
Fix default port for HTTPS.
2015-02-23 23:37:04 -08:00
Ivan Malison
e1f65bcbdc
Add force reset around calls to actual connection from stubs, to ensure
...
compatibility with version of httplib/urlib2 in python 2.7.9. Closes #130 .
2014-12-26 05:10:20 -05:00
Ivan Malison
9d52c3ed42
Remove warning message caused by lack of is_verified property on HTTPSConnection stub.
2014-11-13 16:32:38 -08:00
Rodrigo Taboada
a71c15f398
Create headers field in VCRHTTPResponse. Fixes #117 .
2014-10-24 16:37:12 -02:00
Ivan Malison
a9a68ba44b
Random tweaks.
2014-10-05 18:37:01 -07:00
Ivan Malison
0871c3b87c
Remove instance variables for filter_headers, filter_query_params, ignore_localhost and ignore_hosts. These still exist on the VCR object, but they are automatically translated into a filter function when passed to the cassette.
2014-09-22 17:57:22 -07:00
Ivan Malison
b6e96020c1
Use {[testenv]deps}, instead of repeating testing requirements. Write another failing test for #109
2014-09-19 14:31:49 -07:00
Ivan Malison
958aac3af3
Use mock for patching http connection objects.
2014-09-18 05:32:55 -07:00
Matt Thomson
f719f90e63
Fix multiple header behaviour.
...
Join multiple header values together, rather than losing duplicates with a
dict.
2014-09-06 17:15:15 +01:00
Kevin McCarthy
9a1147196a
getheader() in stubs should be case-insensitive
2014-08-01 16:28:21 -10:00
Kevin McCarthy
70abc5058c
requests 2.3 compat
2014-05-17 12:58:31 -10:00
Kevin McCarthy
8d90dba16c
Ignore requests before trying to play them
...
Closes #79
2014-05-17 09:34:50 -10:00
Kevin McCarthy
8eb54c012f
pep8
2014-05-10 11:52:36 -10:00
Kevin McCarthy
1e8e7057f5
fix python3 compat
2014-05-10 11:52:35 -10:00
Kevin McCarthy
a65da12aeb
change response format
2014-05-10 11:52:34 -10:00
Kevin McCarthy
1f99ede46f
lets try response headers as dicts
2014-05-10 11:52:34 -10:00
Kevin McCarthy
5e295e0603
Serialize dict of lists, use dicts internally
...
There is a weird quirk in HTTP. You can send the same header twice.
For this reason, headers are represented by a dict, with lists as the
values. However, it appears that HTTPlib is completely incapable of
sending the same header twice. This puts me in a weird position: I want
to be able to accurately represent HTTP headers in cassettes, but I
don't want the extra step of always having to do [0] in the general
case, i.e. request.headers['key'][0]
In addition, some servers sometimes send the same header more than once,
and httplib *can* deal with this situation.
Futhermore, I wanted to keep the request and response cassette format as
similar as possible.
For this reason, in cassettes I keep a dict with lists as keys, but once
deserialized into VCR, I keep them as plain, naked dicts.
2014-05-03 17:39:12 -10:00
Max Shytikov
3322234b25
Updated Request with stup to support default ports
2014-05-04 02:12:38 +02:00
Max Shytikov
eab10578d5
Make Request headers to be a dict of lists
2014-05-02 07:32:15 +02:00
Max Shytikov
edf1df9188
Replaced Request 'host, port, protocol, path' with 'uri'
2014-04-30 02:27:52 +02:00
Kevin McCarthy
f317800cb7
Add Logging
...
This helps to figure out which matcher has decided your two cassettes
differ, and figure out when your cassettes have hit the network.
Closes #34
2014-04-27 11:29:06 -10:00
Kevin McCarthy
582b8eab51
pep8
2014-04-23 21:24:12 -10:00
Kevin McCarthy
bc5199c893
improve socket mocking to hopefully pass both new python3.4 socket connection stuff and requests tests
2014-04-23 19:30:43 -10:00
Kevin McCarthy
bd2d2cea72
bump supported python3 version to 3.4
2014-04-23 18:58:17 -10:00
Kevin McCarthy
985e573303
pep8 cleanup
2014-03-08 22:59:10 -10:00
Kevin McCarthy
f5db99f079
need the sock for httplib2, don't want sock for requests, can't we all just get along?
2014-03-08 21:56:25 -10:00
Kevin McCarthy
dedca0f6e7
expose sock, pass correct args to connect in stubs. should fix httplib2 in python3
2014-03-08 21:27:09 -10:00
Kevin McCarthy
0d77d2dcc6
fix self.closed in python3, and request must inherit from httprequest for httplib2
2014-03-08 21:11:50 -10:00
Kevin McCarthy
d187d910b9
Don't try to inherit from the real response object
2014-03-08 20:16:45 -10:00
Åsmund Grammeltvedt
a73da71159
Add Python 2.3 support
...
This commit also adds the 'six' dependency
2014-03-08 20:01:48 -10:00
Roberto Abdelkader Martínez Pérez
46a2c25f6a
httplib2 support
2014-03-08 19:35:30 -10:00
Kevin McCarthy
e84cd6f059
Major Refactor of Stubs
...
So the stubs were getting out of hand, and while trying to add support for the
putrequest and putheader methods, I had an idea for a cleaner way to handle
the stubs using the VCRHTTPConnection more as a proxy object. So
VCRHTTPConnection and VCRHTTPSConnection no longer inherit from HTTPConnection
and HTTPSConnection. This allowed me to get rid of quite a bit of
copy-and-pasted stdlib code.
2014-03-08 19:22:58 -10:00
Kevin McCarthy
84bf7b6132
Load Old Cassettes
...
Add backwards-compatible cassette loading code that can load
the old style header dicts from response cassettes.
2014-01-11 09:28:45 -10:00
Kevin McCarthy
2cf779d776
PEP8 Fixes
2013-12-19 19:43:32 -10:00
Kevin McCarthy
d4494bae50
Let's have the new exceptions subclass basic exception types
2013-12-19 19:43:32 -10:00