mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
pep8 fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import urllib2
|
||||
import vcr
|
||||
|
||||
|
||||
class MockSerializer(object):
|
||||
def __init__(self):
|
||||
self.serialize_count = 0
|
||||
@@ -16,6 +17,7 @@ class MockSerializer(object):
|
||||
self.deserialize_count += 1
|
||||
return ""
|
||||
|
||||
|
||||
def test_registered_serializer(tmpdir):
|
||||
ms = MockSerializer()
|
||||
my_vcr = vcr.VCR()
|
||||
@@ -23,11 +25,11 @@ def test_registered_serializer(tmpdir):
|
||||
tmpdir.join('test.mock').write('test_data')
|
||||
with my_vcr.use_cassette(str(tmpdir.join('test.mock')), serializer='mock'):
|
||||
urllib2.urlopen('http://httpbin.org/')
|
||||
assert ms.serialize_count == 1 # Serializer deserialized once
|
||||
assert ms.cassette_string == 'test_data' # and serialized the test data string
|
||||
assert ms.deserialize_count == 0 # and hasn't serialized yet
|
||||
# Serializer deserialized once
|
||||
assert ms.serialize_count == 1
|
||||
# and serialized the test data string
|
||||
assert ms.cassette_string == 'test_data'
|
||||
# and hasn't serialized yet
|
||||
assert ms.deserialize_count == 0
|
||||
|
||||
assert ms.serialize_count == 1
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user