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
Kevin McCarthy
3990b32892
New Feature: Ignore Some Requests
...
Add 2 new options, ignore_localhost and ignore_hosts, which can ignore
requests so they aren't recorded in a cassette.
Closes #74
2014-05-03 15:25:31 -10:00
Max Shytikov
ce5d2225a6
pep8
2014-05-04 02:12:48 +02:00
Max Shytikov
3322234b25
Updated Request with stup to support default ports
2014-05-04 02:12:38 +02:00
Max Shytikov
5d10a38160
Updated migration to support default ports
2014-05-04 02:11:49 +02:00
Max Shytikov
1d8e2dbb41
Removed accidental print call
2014-05-02 07:32:18 +02:00
Max Shytikov
62d19e5cc1
Update _remove_headers to work with headers copy
...
Because of the filter implementation here we nedd to work only
with clone of the headers and request. subj to refactor
2014-05-02 07:32:18 +02:00
Max Shytikov
998dde61ec
Updated _remove_query_parameters to use latest Request Api
2014-05-02 07:32:17 +02:00
Max Shytikov
faa83b9aba
Fixed name of the variable
2014-05-02 07:32:17 +02:00
Max Shytikov
a48f621bae
Updated _remove_headers to use latest Headers structure
...
Probably we need API in Request object like 'remove_header'
2014-05-02 07:32:17 +02:00
Max Shytikov
7b253ebc6f
pep8
2014-05-02 07:32:17 +02:00
Max Shytikov
5d1f35973d
Make code 2.6 compatible
2014-05-02 07:32:17 +02:00
Max Shytikov
fbb6382c12
Added migration for Request headers to be a dict of lists
2014-05-02 07:32:17 +02:00
Max Shytikov
eab10578d5
Make Request headers to be a dict of lists
2014-05-02 07:32:15 +02:00
Max Shytikov
e4d1db0617
Removed frozenset
2014-04-30 02:38:01 +02:00
Max Shytikov
7e677f516d
Deleted unnecessary __hash__ method of Request
2014-04-30 02:36:27 +02:00
Max Shytikov
25c0141e27
Updated migration script to use new yaml serialization
2014-04-30 02:36:26 +02:00
Max Shytikov
1e995c3c9b
Replaced yaml dump of Request object with plain dict dump
2014-04-30 02:36:26 +02:00
Max Shytikov
0408bdaadb
Added checkfor old cassette on load cassete to persist module
2014-04-30 02:36:26 +02:00
Max Shytikov
9c9612f93e
Fixed crazy/stupid implementation mistakes
2014-04-30 02:36:26 +02:00
Max Shytikov
9d8426e668
Make migration python 2.6 compatible
2014-04-30 02:36:26 +02:00
Max Shytikov
424c658da4
Fixed open tmp file in python3
2014-04-30 02:36:26 +02:00
Max Shytikov
f0972628ef
Fixed migration for one file
2014-04-30 02:36:26 +02:00
Max Shytikov
ee28768a31
Added migration script for old cassettes
2014-04-30 02:36:26 +02:00
Max Shytikov
96d8782d08
Added 'protocol' to Request for backwards compatibility
2014-04-30 02:31:11 +02:00
Max Shytikov
f9a64e1609
Fixed available matchers declaration
2014-04-30 02:31:11 +02:00
Max Shytikov
2fa1aaa1f7
Replaced 'url' mather with 'uri'.
2014-04-30 02:31:11 +02:00
Max Shytikov
2f6db0dc0c
Added scheme to default 'match_on'
2014-04-30 02:30:08 +02:00
Max Shytikov
4267828a3e
Added 'scheme' to Request with matcher and test
2014-04-30 02:29:25 +02:00
Max Shytikov
4e9d5f6885
Updated default 'match_on'
2014-04-30 02:29:25 +02:00
Max Shytikov
9b188e986f
Added query to Request with matcher and test
2014-04-30 02:27:52 +02:00
Max Shytikov
6b060e5666
Added path to Request with matcher and test
2014-04-30 02:27:52 +02:00
Max Shytikov
bd9fa773e8
Added port to Request with matcher and test
2014-04-30 02:27:52 +02:00
Max Shytikov
18ec57fa73
Added test and impl for Request 'host' attribute
2014-04-30 02:27:52 +02:00
Max Shytikov
edf1df9188
Replaced Request 'host, port, protocol, path' with 'uri'
2014-04-30 02:27:52 +02:00
Kevin McCarthy
e6fdc735e4
Filter Sensitive Data From Requests
...
Add the ability to filter out sensitive data, using one of three
methods: from headers, from a query string, and by using a custom
callback to modify the request.
Closes #67
2014-04-27 11:38:28 -10: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
58ac00a7f6
pep8
2014-04-26 21:30:43 -10:00
Kevin McCarthy
6273c32334
Add Exception when JSON Serializing Binary Data
...
Since I can't think of a good way to deal with this, let's just give a
nice error message to point people in the right direction.
Closes #51
2014-04-26 14:31:40 -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
Chris Marusich
955e532162
Add full support for Boto
...
Before this change, vcrpy would not work with modules of Boto (e.g., boto.iam)
that use Boto's CertValidatingHTTPSConnection to connect to AWS (unless you
went through the extra effort of disabling certificate validation during the
tests). This change adds support for those modules.
2014-04-03 13:52:30 -07:00
Kevin McCarthy
6d0a8d8ed9
use six.moves instead of _compat
2014-03-08 23:14:16 -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