← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1840200] Re: Misuse of 'assert_has_calls' in unit tests

 

Reviewed:  https://review.opendev.org/676536
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ad482e53fbb956288e73692f6bff5f74d862fe5d
Submitter: Zuul
Branch:    master

commit ad482e53fbb956288e73692f6bff5f74d862fe5d
Author: Takashi NATSUME <natsume.takashi@xxxxxxxxxxxxx>
Date:   Thu Aug 15 10:00:38 2019 +0900

    Fix 'has_calls' method calls in unit tests
    
    The 'has_calls' method does not exist in assertion methods of mock.
    Replace the 'has_calls' method with an 'assert_has_calls' method or
    an 'assert_called_once_with' method.
    Add an 'assertEqual' check before an 'assert_has_calls' method.
    
    Change-Id: I4b606fce473d064b9bb00213696c075cea020aaf
    Closes-Bug: #1840200


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1840200

Title:
  Misuse of 'assert_has_calls' in unit tests

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) ocata series:
  Confirmed
Status in OpenStack Compute (nova) pike series:
  Confirmed
Status in OpenStack Compute (nova) queens series:
  Confirmed
Status in OpenStack Compute (nova) rocky series:
  Confirmed
Status in OpenStack Compute (nova) stein series:
  Confirmed

Bug description:
  In unit tests, 'has_calls' method is used to assert mock calls.
  But 'has_calls' does not exist in assertion methods.
  It should be 'assert_has_calls'.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1840200/+subscriptions


References