From a6c59c20d2fea561e486fabb7c241bc1afaafcae Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sun, 11 Aug 2013 17:07:13 -1000 Subject: [PATCH] remove debugging code from Request and add repr --- tests/integration/test_request.py | 3 +++ vcr/request.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_request.py b/tests/integration/test_request.py index 9fdc84a..1875a4d 100644 --- a/tests/integration/test_request.py +++ b/tests/integration/test_request.py @@ -3,7 +3,10 @@ import vcr def test_recorded_request_url_with_redirected_request(tmpdir): with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass: + assert len(cass) == 0 urllib2.urlopen('http://google.com') + print cass.requests + print cass.requests[0] assert cass.requests[0].url == 'http://google.com' assert cass.requests[1].url == 'http://www.google.com/' assert len(cass) == 2 diff --git a/vcr/request.py b/vcr/request.py index d91e29f..86e63e3 100644 --- a/vcr/request.py +++ b/vcr/request.py @@ -12,7 +12,6 @@ class Request(object): @property def url(self): - print self.protocol, self.host, self.path return "{0}://{1}{2}".format(self.protocol, self.host, self.path) def __key(self): @@ -26,3 +25,6 @@ class Request(object): def __str__(self): return "".format(self.method, self.url) + + def __repr__(self): + return self.__str__()