From 9d8084113dad9e958edbd6119cc499b45fa8e92e Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sun, 11 Aug 2013 18:42:09 -1000 Subject: [PATCH] add the test from the readme --- README.md | 2 +- tests/integration/test_basic.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a18519..cb24a77 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ import urllib2 with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'): response = urllib2.urlopen('http://www.iana.org/domains/reserved').read() - assert 'Example Domains' in response + assert 'Example domains' in response ``` Run this test once, and VCR.py will record the http request to diff --git a/tests/integration/test_basic.py b/tests/integration/test_basic.py index 5b26de7..31fb6c6 100644 --- a/tests/integration/test_basic.py +++ b/tests/integration/test_basic.py @@ -30,3 +30,10 @@ def test_unpatch(tmpdir): urllib2.urlopen('http://httpbin.org/').read() assert cass.play_count == 0 +def test_basic_use(tmpdir): + ''' + Copied from the docs + ''' + with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'): + response = urllib2.urlopen('http://www.iana.org/domains/reserved').read() + assert 'Example domains' in response