Misuse of assertTrue in test scripts

Bug #1223620 reported by Zhongyue Luo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Zhongyue Luo

Bug Description

Below modules have places where assertTrue is used when assertEqual is needed

nova/tests/consoleauth/test_consoleauth.py
nova/tests/image/test_s3.py
nova/tests/objects/test_objects.py

Zhongyue Luo (zyluo)
Changed in nova:
assignee: nobody → Zhongyue Luo (zyluo)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/45151
Committed: http://github.com/openstack/nova/commit/40a718e30e4ea27eaff85f51792beb9bff71169e
Submitter: Jenkins
Branch: master

commit 40a718e30e4ea27eaff85f51792beb9bff71169e
Author: Zhongyue Luo <email address hidden>
Date: Thu Sep 5 08:57:11 2013 +0800

    Fixes misuse of assertTrue in test scripts

    Misuse of assertTrue in places where assertEqual or assertIn should be used.

    If assertTrue is used, the test will always pass
    if the first argument's boolean cast is True. The second argument
    passed to assertTrue() will be regarded as the error message
    when the assertion fails.

    Fixes bug #1223620

    Change-Id: I46b51bf944ba22247901172650ea6867dd525aa7

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → havana-rc1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
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.