1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00
This commit is contained in:
Kevin McCarthy
2012-05-30 21:09:28 -10:00
parent 4ad6be7787
commit 3a4b9add6a

View File

@@ -5,6 +5,7 @@ import urllib2
TEST_CASSETTE_FILE = 'test/test_req.yaml'
class TestHttpRequest(unittest.TestCase):
def setUp(self):
@@ -16,12 +17,12 @@ class TestHttpRequest(unittest.TestCase):
def test_response_code(self):
with vcr.use_cassette(TEST_CASSETTE_FILE):
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):
with vcr.use_cassette('test/synopsis.yaml'):
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__':