]> khamidou — GitHub mirrors - vcrpy.git/commit
Add a failing test to illustrate a hole in vcrpy's Boto support
authorChris Marusich <marusich@users.noreply.github.com>
Thu, 3 Apr 2014 19:08:41 +0000 (12:08 -0700)
committerChris Marusich <marusich@users.noreply.github.com>
Thu, 3 Apr 2014 20:21:33 +0000 (13:21 -0700)
commit20ff2e9d9ae53e5614a47c89d527e359a281574b
tree0b52a7434700e7eaab3d23c4815990ea9b844dad
parent544d2127d3d1241abc5b4814bdc1308744480be9
Add a failing test to illustrate a hole in vcrpy's Boto support

This test will fail with the following error:

TypeError: unbound method __init__() must be called with VCRHTTPConnection
instance as first argument (got CertValidatingHTTPSConnection instance instead)

The TypeError is raised because the __init__ method of Boto's
CertValidatingHTTPSConnection (which extends httplib.HTTPConnection) calls
httplib.HTTPConnection.__init__, and during the test httplib.HTTPConnection
actually refers to the patched verison (i.e., VCRHTTPConnection).  When
VCRHTTPConnection.__init__ is called, it expects to receive a
VCRHTTPConnection object as its first argument, but instead it receives a
CertValidatingHTTPSConnection object.  Because the only ancestor class of
CertValidatingHTTPSConnection is the original, un-patched
httplib.HTTPConnection, the first argument is not considered to be a
VCRHTTPConnection object, so a TypeError is raised.
tests/integration/test_boto.py