mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
remove debugging code from Request and add repr
This commit is contained in:
@@ -3,7 +3,10 @@ import vcr
|
|||||||
|
|
||||||
def test_recorded_request_url_with_redirected_request(tmpdir):
|
def test_recorded_request_url_with_redirected_request(tmpdir):
|
||||||
with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass:
|
with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass:
|
||||||
|
assert len(cass) == 0
|
||||||
urllib2.urlopen('http://google.com')
|
urllib2.urlopen('http://google.com')
|
||||||
|
print cass.requests
|
||||||
|
print cass.requests[0]
|
||||||
assert cass.requests[0].url == 'http://google.com'
|
assert cass.requests[0].url == 'http://google.com'
|
||||||
assert cass.requests[1].url == 'http://www.google.com/'
|
assert cass.requests[1].url == 'http://www.google.com/'
|
||||||
assert len(cass) == 2
|
assert len(cass) == 2
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class Request(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self):
|
def url(self):
|
||||||
print self.protocol, self.host, self.path
|
|
||||||
return "{0}://{1}{2}".format(self.protocol, self.host, self.path)
|
return "{0}://{1}{2}".format(self.protocol, self.host, self.path)
|
||||||
|
|
||||||
def __key(self):
|
def __key(self):
|
||||||
@@ -26,3 +25,6 @@ class Request(object):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "<Request ({0}) {1}>".format(self.method, self.url)
|
return "<Request ({0}) {1}>".format(self.method, self.url)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__str__()
|
||||||
|
|||||||
Reference in New Issue
Block a user