Wrong assert in nova.tests.virt.vmwareapi.test_vmops.py

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

Bug Description

bad assertion in nova.tests.virt.vmwareapi.vmwareapi.test_vmops.py:640

self.assertTrue(3, len(mock_mkdir.mock_calls)) should be replaced with assertEqual

Changed in nova:
assignee: nobody → Sergey Nikitin (snikitin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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/103550
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=aaa9d6a8a28335b8dac4e1d4045571aa565e3196
Submitter: Jenkins
Branch: master

commit aaa9d6a8a28335b8dac4e1d4045571aa565e3196
Author: Sergey Nikitin <email address hidden>
Date: Mon Jun 30 17:55:46 2014 +0400

    Fixed wrong assertion in test_vmops.py

    There is wrong assert method in
    nova.tests.virt.vmwareapi.vmwareapi.test_vmops.py:640
    while checking a number of calls mocked method 'mkdir'.

    We should use assertEqual(3, len(mock_mkdir.mock_calls))
    instead of self.assertTrue(3, len(mock_mkdir.mock_calls))

    But number of calling method 'mkdir' not always is 3.
    If dict block_device_info contains key 'block_device_mapping'
    with any information, method 'mkdir' wouldn't be called in method
    self._vmops.spawn(). That is why corresponding check been added.

    Change-Id: Ifc26e112b9c2974e0fb7a91ba39d5b2d887bd549
    Closes-Bug: #1335859

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