test_extend_list_exceed_max_uri_len() incorrectly mocks HTTPClient.request() method

Bug #1192197 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Undecided
Roman Podoliaka

Bug Description

While working on https://review.openstack.org/#/c/27270/ I encountered the following issue:

test_extend_list_exceed_max_uri_len (tests.unit.test_cli20_network) mocks the request() method of HTTPClient class so that it raises the RequestURITooLong exception. But the real method can't possibly raise it (Client.do_request() does this instead). Mocks should emulate the behavior of methods they stub out and not change it in any way.

Tags: tests
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-quantumclient (master)

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

Changed in python-quantumclient:
assignee: nobody → Roman Podolyaka (rpodolyaka)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-quantumclient (master)

Reviewed: https://review.openstack.org/33452
Committed: http://github.com/openstack/python-quantumclient/commit/e7593e1a8401de7b8d9e3dc3f67533cb2455132f
Submitter: Jenkins
Branch: master

commit e7593e1a8401de7b8d9e3dc3f67533cb2455132f
Author: Roman Podolyaka <email address hidden>
Date: Tue Jun 18 17:47:13 2013 +0300

    Fix mocking of HTTPClient.request() method.

    The test_extend_list_exceed_max_uri_len test case mocks
    the request() method of HTTPClient class so that it raises
    the RequestURITooLong exception. But the real method can't
    possibly raise it (Client.do_request() does this instead).
    Mocks should emulate the behavior of methods they stub out
    and not change it in any way.

    Fixes bug 1192197.

    Change-Id: I62b2db111ef251f95eb9aa9c9cc00b53fdbccc68

Changed in python-quantumclient:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
milestone: none → 2.2.1-2.2.6
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.