mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
PEP8
This commit is contained in:
5
test.py
5
test.py
@@ -5,6 +5,7 @@ import urllib2
|
|||||||
|
|
||||||
TEST_CASSETTE_FILE = 'test/test_req.yaml'
|
TEST_CASSETTE_FILE = 'test/test_req.yaml'
|
||||||
|
|
||||||
|
|
||||||
class TestHttpRequest(unittest.TestCase):
|
class TestHttpRequest(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@@ -16,12 +17,12 @@ class TestHttpRequest(unittest.TestCase):
|
|||||||
def test_response_code(self):
|
def test_response_code(self):
|
||||||
with vcr.use_cassette(TEST_CASSETTE_FILE):
|
with vcr.use_cassette(TEST_CASSETTE_FILE):
|
||||||
code = urllib2.urlopen('http://www.iana.org/domains/example/').getcode()
|
code = urllib2.urlopen('http://www.iana.org/domains/example/').getcode()
|
||||||
self.assertEqual(code,urllib2.urlopen('http://www.iana.org/domains/example/').getcode())
|
self.assertEqual(code, urllib2.urlopen('http://www.iana.org/domains/example/').getcode())
|
||||||
|
|
||||||
def test_response_body(self):
|
def test_response_body(self):
|
||||||
with vcr.use_cassette('test/synopsis.yaml'):
|
with vcr.use_cassette('test/synopsis.yaml'):
|
||||||
body = urllib2.urlopen('http://www.iana.org/domains/example/').read()
|
body = urllib2.urlopen('http://www.iana.org/domains/example/').read()
|
||||||
self.assertEqual(body,urllib2.urlopen('http://www.iana.org/domains/example/').read())
|
self.assertEqual(body, urllib2.urlopen('http://www.iana.org/domains/example/').read())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user