mock.assert_called_once() is not a valid mock method

Bug #1365745 reported by Ruby Loo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Low
Ruby Loo

Bug Description

There are a few places in ironic (nova/tests/virt/ironic/test_driver.py & tests/conductor/test_manager.py) where calls to mock.assert_called_once() are made. The problem is that this isn't a valid mock method, and 'assert_called_once' isn't a valid method of whatever is being mocked. So it doesn't actually do anything.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

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

Reviewed: https://review.openstack.org/119234
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=f011b430ae66012a673ed5657d39ffe8c89441ed
Submitter: Jenkins
Branch: master

commit f011b430ae66012a673ed5657d39ffe8c89441ed
Author: Ruby Loo <email address hidden>
Date: Thu Sep 4 22:14:52 2014 +0000

    mock.assert_called_once() is not valid method

    There are a few places in tests/conductor/test_manager.py where calls to
    mock.assert_called_once() are made. The problem is that this isn't a valid
    mock method, and 'assert_called_once' isn't a valid method of whatever is
    being mocked. So it doesn't actually do anything.

    This replaces the assert_called_once() calls with valid
    assert_called_once_with() calls.

    Change-Id: I7d46cf866bcce3b7e09bc556f2a1ddd10e4d1ca5
    Partial-Bug: #1365745

Revision history for this message
Dmitry Tantsur (divius) wrote :

$ grep -rE "assert_called_once[^_]" ironic
$

seems fixed now

Changed in ironic:
status: In Progress → Fix Committed
Revision history for this message
Ruby Loo (rloo) wrote :

Thx for updating the status Dmitry. It was left open because nova/tests/virt/ironic/test_driver.py was in the ironic tree, but it is now in the nova tree, so this is fixed in ironic. ;)

Thierry Carrez (ttx)
Changed in ironic:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: juno-rc1 → 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.