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:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user