]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Only use the relative path in HTTP requests v0.3.1
authorKevin McCarthy <me@kevinmccarthy.org>
Tue, 17 Sep 2013 23:18:26 +0000 (13:18 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Tue, 17 Sep 2013 23:19:26 +0000 (13:19 -1000)
This causes a pretty big problem on out-of-spec HTTP servers (like
Flickr). Closes #31

README.md
setup.py
tests/integration/test_wild.py
vcr/stubs/__init__.py

index b7f481d1281b71b734fb849d281027237b1d4e91..59e90c2e1684dd14943525a0d598606b6fc3abfb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -259,6 +259,8 @@ This library is a work in progress, so the API might change on you.
 There are probably some [bugs](https://github.com/kevin1024/vcrpy/issues?labels=bug&page=1&state=open) floating around too.
 
 ##Changelog
+* 0.3.1: Fix issue causing full paths to be sent on the HTTP request
+  line.
 * 0.3.0: *Backwards incompatible release* - Added support for record
   modes, and changed the default recording behavior to the "once" record
   mode.  Please see the documentation on record modes for more.  Added
index de566bb3b8db4ceaefe01ef21793ffe3a1ef469c..96104b95468987ad03866da476e1ec9f41207da8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ class PyTest(TestCommand):
         sys.exit(errno)
 
 setup(name='vcrpy',
-      version='0.3.0',
+      version='0.3.1',
       description="A Python port of Ruby's VCR to make mocking HTTP easier",
       author='Kevin McCarthy',
       author_email='me@kevinmccarthy.org',
index 335c4395b48ed8c18c47053f37e4fac2631a339d..167219d4bd44f54b510950f7ca2f0ea274b6a6c9 100644 (file)
@@ -45,3 +45,9 @@ def test_flickr_multipart_upload():
         assert len(cass) == 1
         _pretend_to_be_flickr_library()
         assert cass.play_count == 1
+
+def test_flickr_should_respond_with_200(tmpdir):
+    testfile = str(tmpdir.join('flickr.yml'))
+    with vcr.use_cassette(testfile):
+        r = requests.post("http://api.flickr.com/services/upload")
+        assert r.status_code == 200
index 6510ce9306d36501ad14bfe222a4e619b8ecde54..d779cc26b17d8388290bee69ff509f6b104a9ed1 100644 (file)
@@ -79,7 +79,7 @@ class VCRConnectionMixin:
 
     def _send_request(self, method, url, body, headers):
         """
-        Coppy+pasted from python stdlib 2.6 source because it
+        Copy+pasted from python stdlib 2.6 source because it
         has a call to self.send() which I have overridden
         #stdlibproblems #fml
         """
@@ -160,7 +160,7 @@ class VCRConnectionMixin:
             self._baseclass.request(
                 self,
                 method=self._vcr_request.method,
-                url=self._vcr_request.url,
+                url=self._vcr_request.path,
                 body=self._vcr_request.body,
                 headers=dict(self._vcr_request.headers or {})
             )