]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
formatting fixes
authorKevin McCarthy <me@kevinmccarthy.org>
Mon, 2 Dec 2013 00:38:46 +0000 (14:38 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 2 Dec 2013 00:38:46 +0000 (14:38 -1000)
vcr/cassette.py
vcr/persisters/filesystem.py
vcr/stubs/__init__.py

index 8e6816f1b5d820680c7eef32fbef96168d14a69c..e47808220c3692287bc1b32c1f7b58560cfb5a04 100644 (file)
@@ -78,10 +78,13 @@ class Cassette(object):
     def responses_of(self, request):
         '''
         Find the responses corresponding to a request.
-       This function isn't actually used by VCR internally, but is
-       provided as an external API.
+        This function isn't actually used by VCR internally, but is
+        provided as an external API.
         '''
-        responses = [resp for req, resp in self.data if requests_match(req, request, self._match_on)]
+        responses = \
+            [resp for req, resp in self.data if
+                requests_match(req, request, self._match_on)]
+
         if responses:
             return responses
         # I decided that a KeyError is the best exception to raise
index 7eb61098844fee889f2f6d2a57b8e62876769d06..9b00fa09e3b174c6ab82222dd55b5159c5fda7a3 100644 (file)
@@ -8,5 +8,5 @@ class FilesystemPersister(object):
         dirname, filename = os.path.split(cassette_path)
         if dirname and not os.path.exists(dirname):
             os.makedirs(dirname)
-       with open(cassette_path, 'w') as f:
-           f.write(data)
+        with open(cassette_path, 'w') as f:
+            f.write(data)
index 5eb75489ba01feb1e6769ebf1ff0e327f34597f9..9871069713340c417636f650b424fd0806876f02 100644 (file)
@@ -165,12 +165,17 @@ class VCRConnectionMixin:
         '''Retrieve a the response'''
         # Check to see if the cassette has a response for this request. If so,
         # then return it
-        if self._vcr_request in self.cassette and  self.cassette.record_mode != "all" and self.cassette.rewound:
+        if self._vcr_request in self.cassette and \
+                self.cassette.record_mode != "all" and \
+                self.cassette.rewound:
             response = self.cassette.play_response(self._vcr_request)
             return VCRHTTPResponse(response)
         else:
             if self.cassette.write_protected:
-                raise Exception("Can't overwrite existing cassette in your current record mode.")
+                raise Exception(
+                    "Can't overwrite existing cassette in \
+                     your current record mode."
+                )
 
             # Otherwise, we should send the request, then get the response
             # and return it.