]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
change response to response_of
authorKevin McCarthy <me@kevinmccarthy.org>
Sat, 10 Aug 2013 23:00:23 +0000 (13:00 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:41 +0000 (15:05 -1000)
tests/unit/test_cassettes.py
vcr/cassette.py
vcr/stubs/__init__.py

index d4ba5112e27fa7c959c2fd201397e889f4ae847c..f692ba566fe6e94fdf9233f005fb7078bc12dded 100644 (file)
@@ -44,12 +44,12 @@ def test_cassette_contains():
     a.append('foo','bar')
     assert 'foo' in a
 
-def test_cassette_response():
+def test_cassette_response_of():
     a = Cassette('test')
     a.append('foo','bar')
-    assert a.response('foo') == 'bar'
+    assert a.response_of('foo') == 'bar'
 
-def test_cassette_missing_response():
+def test_cassette_get_missing_response():
     a = Cassette('test')
     with pytest.raises(KeyError):
-        a.response('foo')
+        a.response_of('foo')
index 5b158d6f24f26b98e58d8b1a2f8ceb44954b6a41..11f6f032bd27796f9aa1ad5000ed67a717c60b7f 100644 (file)
@@ -52,7 +52,7 @@ class Cassette(object):
         '''Add a pair of request, response to this cassette'''
         self.data[request] = response
 
-    def response(self, request):
+    def response_of(self, request):
         '''Find the response corresponding to a request'''
         return self.data[request]
 
index bea95462742e7d29614189b17c0b17c19b2eb399..eba447b2fd38c1e962253b5c5c5073c88248afb4 100644 (file)
@@ -69,7 +69,7 @@ class VCRConnectionMixin:
         # Check to see if the cassette has a response for this request. If so,
         # then return it
         if self._request in self.cassette:
-            response = self.cassette.response(self._request)
+            response = self.cassette.response_of(self._request)
             # Alert the cassette to the fact that we've served another
             # response for the provided requests
             self.cassette.mark_played(self._request)