1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

add the test from the readme

This commit is contained in:
Kevin McCarthy
2013-08-11 18:42:09 -10:00
parent 5c0a1e1769
commit 9d8084113d
2 changed files with 8 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ import urllib2
with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'): with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'):
response = urllib2.urlopen('http://www.iana.org/domains/reserved').read() 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 Run this test once, and VCR.py will record the http request to

View File

@@ -30,3 +30,10 @@ def test_unpatch(tmpdir):
urllib2.urlopen('http://httpbin.org/').read() urllib2.urlopen('http://httpbin.org/').read()
assert cass.play_count == 0 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