]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
update readme
authorKevin McCarthy <me@kevinmccarthy.org>
Thu, 8 Aug 2013 07:55:32 +0000 (21:55 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:41 +0000 (15:05 -1000)
README.md

index 58c4759c85db881d599c0289958390335b962847..1286b4c5440023527f53970e1c83ce5e8a45f5af 100644 (file)
--- a/README.md
+++ b/README.md
@@ -33,6 +33,28 @@ pass, even if you are offline, or iana.org goes down for maintenance) and
 accurate (the response will contain the same headers and body you get from a
 real request).
 
+## Advanced Features
+
+If you want, VCR.py can return information about the cassette it is
+using to record your requests and responses.  This will let you record
+your requests and responses and make assertions on them, to make sure
+that your code under test is generating the expected requests and
+responses.  This feature is not present in Ruby's VCR, but I think it is
+a nice addition.  Here's an example:
+
+```python
+import vcr
+import urllib2
+
+with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass:
+    response = urllib2.urlopen('http://www.zombo.com/').read()
+    # cass should have 1 request inside it
+    assert len(cass) == 1 
+    # the request URL should be 'http://www.zombo.com/'
+    assert cass.requests.keys()[0].url == 'http://www.zombo.com/'
+```
+
+
 ##Installation
 
 I finally uploaded VCR.py to pypi!  So you can just `pip install vcrpy` (first you may need to `brew install libyaml` [[Homebrew](http://mxcl.github.com/homebrew/)])
@@ -47,6 +69,9 @@ This library is a work in progress, so the API might change on you.
 There are probably some [bugs](https://github.com/kevin1024/vcrpy/issues?labels=bug&page=1&state=open) floating around too.
 
 ##Changelog
+* 0.1.0: *backwards incompatible release - delete your old cassette
+  files*:  This release adds the ability to access the cassette to make
+assertions on it, as well as a major code refactor thanks to @dlecocq
 * 0.0.4: If you have libyaml installed, vcrpy will use the c bindings
   instead.  Speed up your tests!  Thanks @dlecocq
 * 0.0.3: Add support for requests 1.2.3.  Support for older versions of requests dropped (thanks @vitormazzi and @bryanhelmig)