assertion of type in tests should be done with assertIsInstance

Bug #1259941 reported by Pavlo Shchelokovskyy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Pavlo Shchelokovskyy

Bug Description

some of heat tests use different variants of assertTrue(isinstance(A, B)) or assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B) provided by testtools.

Changed in heat:
assignee: nobody → Pavlo Shchelokovskyy (pshchelo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/61436
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=10f193ee9221acaba19b22e913c0092ba07e492c
Submitter: Jenkins
Branch: master

commit 10f193ee9221acaba19b22e913c0092ba07e492c
Author: Pavlo Shchelokovskyy <email address hidden>
Date: Sat Jan 4 08:32:19 2014 +0200

    Fix asserttion of types

    Some code in tests is uisng assertTrue(isinstance(A, B))
    or assertEqual(B, type(A)). assertIsInstance must be used instead.

    assertIsInstance is provided by testtools package, so this change is not
    breaking backward compatibility with Python 2.6.

    Closes-Bug: #1259941

    Change-Id: Ib601aebabc0ff0318cd87cc199c808e6b59f7c9f

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-2 → 2014.1
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.