Inconsistency with new requests-mock and requests

Bug #1363632 reported by Jamie Lennox
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
Medium
Jamie Lennox
python-novaclient
Fix Released
Low
Jamie Lennox

Bug Description

New version of requests and requests-mock expose a mistake in one of the tests.

        self.stub_auth(status_code=305, body='Use Proxy',
                       headers={'Location': self.TEST_ADMIN_URL + "/tokens"})

body should always be a io object with a .read()

leads to a failure like:

2014-08-31 05:47:38.836 | ======================================================================
2014-08-31 05:47:38.836 | FAIL: keystoneclient.tests.v2_0.test_auth.AuthenticateAgainstKeystoneTests.test_auth_redirect
2014-08-31 05:47:38.837 | tags: worker-5
2014-08-31 05:47:38.837 | ----------------------------------------------------------------------
2014-08-31 05:47:38.837 | pythonlogging:'': {{{Making authentication request to http://127.0.0.1:5000/v2.0/tokens}}}
2014-08-31 05:47:38.837 |
2014-08-31 05:47:38.838 | Traceback (most recent call last):
2014-08-31 05:47:38.838 | File "keystoneclient/tests/v2_0/test_auth.py", line 113, in test_auth_redirect
2014-08-31 05:47:38.838 | auth_url=self.TEST_URL)
2014-08-31 05:47:38.839 | File "keystoneclient/v2_0/client.py", line 147, in __init__
2014-08-31 05:47:38.839 | self.authenticate()
2014-08-31 05:47:38.839 | File "keystoneclient/utils.py", line 318, in inner
2014-08-31 05:47:38.839 | return func(*args, **kwargs)
2014-08-31 05:47:38.840 | File "keystoneclient/httpclient.py", line 428, in authenticate
2014-08-31 05:47:38.840 | resp = self.get_raw_token_from_identity_service(**kwargs)
2014-08-31 05:47:38.840 | File "keystoneclient/v2_0/client.py", line 190, in get_raw_token_from_identity_service
2014-08-31 05:47:38.841 | "%s" % e)

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/118031

Changed in python-keystoneclient:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/118034

Changed in python-novaclient:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Revision history for this message
Yukinori Sagara (sagara) wrote :

This bug blocks keystoneclient unit test. We need to resolve this bug immediately.

The combination of requests 2.3.0 & requests-mock 0.5.1 works fine, but requests 2.4.0 (current) & requests-mock 0.5.1
fails to pass the test. We need to apply Jamie's patch or pin requests version to 2.3.0.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/118031
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=1643f7da32b1f729f12d042565d8c67f10f91b8c
Submitter: Jenkins
Branch: master

commit 1643f7da32b1f729f12d042565d8c67f10f91b8c
Author: Jamie Lennox <email address hidden>
Date: Sun Aug 31 20:48:46 2014 +1000

    Fix test mistake with requests-mock

    body= parameters are supposed to be io objects. This is obviously during
    the conversion from HTTPretty.

    Change-Id: Ia8ec9294e054e2231aa4a5e2633e2b7d5d15066a
    Closes-Bug: #1363632

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/118034
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=319b61aa2f7aa8f4ef424e86add4b3dea87afb84
Submitter: Jenkins
Branch: master

commit 319b61aa2f7aa8f4ef424e86add4b3dea87afb84
Author: Jamie Lennox <email address hidden>
Date: Sun Aug 31 21:56:24 2014 +1000

    Fix test mistake with requests-mock

    body= parameters are supposed to be io objects. This is obviously during
    the conversion from HTTPretty.

    Change-Id: I2f2077fbe219805c4aaf9db19bc53ad7e4dde4dd
    Closes-Bug: #1363632

Changed in python-novaclient:
status: In Progress → Fix Committed
Michael Still (mikal)
Changed in python-novaclient:
importance: Undecided → Low
milestone: none → 2.19.0
Michael Still (mikal)
Changed in python-novaclient:
status: Fix Committed → Fix Released
David Stanek (dstanek)
Changed in python-keystoneclient:
milestone: none → 0.11.0
Dolph Mathews (dolph)
Changed in python-keystoneclient:
importance: Undecided → Medium
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.