Ivan Malison
958aac3af3
Use mock for patching http connection objects.
2014-09-18 05:32:55 -07:00
Ivan Malison
9a564586a4
Failing tests for nested context decoration.
2014-09-18 03:46:39 -07:00
Ivan Malison
643a4c91ee
Change use_cassette to pass a function to CassetteContextDecorator so that changes to the default settings on the vcr properly propogate.
2014-09-18 02:52:44 -07:00
Ivan Malison
472cc3bffe
use_cassette -> CassetteContextDecorator
2014-09-17 23:22:43 -07:00
Ivan Malison
a08c90c5d6
Revert "Add global toggle to use_cassette."
...
This reverts commit 366e2b75bb .
Conflicts:
tests/unit/test_cassettes.py
2014-09-17 21:42:25 -07:00
Ivan Malison
9a4f5f23a4
Add before_record_response to Cassette and VCR.
2014-09-17 04:10:05 -07:00
Ivan Malison
366e2b75bb
Add global toggle to use_cassette.
2014-09-17 01:28:54 -07:00
Ivan Malison
cb05f4163c
Add use_cassette class so functinos that are decorated with use_cassette can be called multiple times.
2014-09-16 23:45:05 -07:00
Matt Thomson
3c410b5f9d
Don't write header values multiple times.
...
On Python 3, response.msg.keys() contains the same value multiple times if
there are multiple headers with the same value. Work around this by
converting to a set before iterating over it.
2014-09-06 16:57:12 +01:00
Matt Thomson
7a5795a547
Add test to demonstrate Python 3 multiple headers bug.
2014-09-06 16:32:29 +01:00
Kevin McCarthy
9a1147196a
getheader() in stubs should be case-insensitive
2014-08-01 16:28:21 -10:00
Kevin McCarthy
8d90dba16c
Ignore requests before trying to play them
...
Closes #79
2014-05-17 09:34:50 -10:00
Kevin McCarthy
3b05d499c3
Merge pull request #78 from mshytikov/feature/cassette-all-played
...
Feature/Cassette#all_played
2014-05-10 11:58:28 -10:00
Kevin McCarthy
83ff73792e
forgot to check in tests
2014-05-10 11:52:36 -10:00
Kevin McCarthy
b671e7ab99
headers dont retain order anymore.... sigh
2014-05-10 11:52:35 -10:00
Kevin McCarthy
b36a1157e7
Just make all the headers lower for now
2014-05-10 11:52:35 -10:00
Kevin McCarthy
66c6909021
not really very happy about this
2014-05-10 11:52:35 -10:00
Kevin McCarthy
c0691a96e6
flickr test was actually using yaml cassettes
2014-05-10 11:52:35 -10:00
Kevin McCarthy
a302874c6d
update old cassette detection
2014-05-10 11:52:35 -10:00
Kevin McCarthy
b43c63f284
update serializers
2014-05-10 11:52:35 -10:00
Kevin McCarthy
e50f917cf4
Make Serializers Dumber
...
Let's have the serializer just worry about serializing the dict
that we hand it, and move the unicode stuff up to a serialize module.
This should hopefully let us move toward using a version string in
cassettes.
2014-05-10 11:52:35 -10:00
Kevin McCarthy
23b5d49736
fix migration script
2014-05-10 11:52:35 -10:00
Kevin McCarthy
2da49884be
update wild cassette to match new format
2014-05-10 11:52:35 -10:00
Kevin McCarthy
d1a3ab56b1
update migration fixtures
2014-05-10 11:52:34 -10:00
Max Shytikov
bd2121d34e
pep8
2014-05-06 00:46:32 +02:00
Max Shytikov
f9f2b98427
Added tests for Cassette#all_played
2014-05-06 00:46:03 +02: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
Kevin McCarthy
0be7d6f238
oops, forgot to commit new tests for ignore feature
2014-05-03 15:52:45 -10:00
Max Shytikov
78f6ce46b5
Added test casses and refactored test for Request#port
2014-05-04 02:20:46 +02:00
Max Shytikov
0b1aeac25e
Renamed outdated url to uri.
2014-05-04 02:11:49 +02:00
Max Shytikov
1190a0e62e
Removed default '80' port of uri in tests
2014-05-04 02:11:49 +02:00
Max Shytikov
61e3bdc402
Added tetst for uri and port of Request
2014-05-03 22:31:30 +02:00
Max Shytikov
1ff5d08c8b
Fixed typo
2014-05-02 07:32:18 +02:00
Max Shytikov
3d2da26933
Updated test to use new headers structure
2014-05-02 07:32:18 +02:00
Max Shytikov
65c2797f94
Updated test for filters. Mock replaced with real Request object
2014-05-02 07:32:18 +02:00
Max Shytikov
fbd5049d38
Updated test to use new Request constructor
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
34ce0a35ec
Updated wild fixtures in correspondence with new fixture format
2014-04-30 02:36:27 +02:00
Max Shytikov
b6195bf41e
Updated migration fixtures in correspondence with new fixture format
2014-04-30 02:36:27 +02:00
Max Shytikov
eedafb19ee
Added more test for persist
2014-04-30 02:36:27 +02:00
Max Shytikov
434d6325ea
Udated migration test for yaml. replaced strict content comparision
...
What we care about it is actually data after loading not the
strict format of yaml file
2014-04-30 02:36:27 +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
a3eac1f0ec
Added tests for persist module
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
750e141b9d
Added integration tests for matchers
2014-04-30 02:36:25 +02:00
Max Shytikov
2fa1aaa1f7
Replaced 'url' mather with 'uri'.
2014-04-30 02:31:11 +02:00
Max Shytikov
7fe55ad8b8
Updated 'set' to be compatible with 2.6
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
5015dbd878
Improved test samples
2014-04-30 02:27:52 +02:00
Max Shytikov
9b188e986f
Added query to Request with matcher and test
2014-04-30 02:27:52 +02:00