← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1297875] [NEW] some tests call "called_once_with_args" with no assert, those lines are ignored

 

Public bug reported:

A few tests use "called_once_with_args"  instead of mock's "assert_called_once_with_args"
without checking the result.

That means that we're not asserting for that to happen.

Those tests need to be fixed.


[majopela@f20-devstack neutron]$ grep ".called_once_with" * -R | grep -v assert
neutron/tests/unit/test_dhcp_agent.py:            disable.called_once_with_args(network.id)

neutron/tests/unit/test_dhcp_agent.py:
uuid5.called_once_with(uuid.NAMESPACE_DNS, 'localhost')

neutron/tests/unit/test_post_mortem_debug.py:
mock_print_exception.called_once_with(*exc_info)

neutron/tests/unit/test_db_migration.py:
mock_open.write.called_once_with('a')

neutron/tests/unit/test_agent_netns_cleanup.py:
ovs_br_cls.called_once_with('br-int', conf.AGENT.root_helper)

neutron/tests/unit/test_metadata_agent.py:
self.eventlet.wsgi.server.called_once_with(

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1297875

Title:
  some tests call "called_once_with_args" with no assert, those lines
  are ignored

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  A few tests use "called_once_with_args"  instead of mock's "assert_called_once_with_args"
  without checking the result.

  That means that we're not asserting for that to happen.

  Those tests need to be fixed.

  
  [majopela@f20-devstack neutron]$ grep ".called_once_with" * -R | grep -v assert
  neutron/tests/unit/test_dhcp_agent.py:            disable.called_once_with_args(network.id)

  neutron/tests/unit/test_dhcp_agent.py:
  uuid5.called_once_with(uuid.NAMESPACE_DNS, 'localhost')

  neutron/tests/unit/test_post_mortem_debug.py:
  mock_print_exception.called_once_with(*exc_info)

  neutron/tests/unit/test_db_migration.py:
  mock_open.write.called_once_with('a')

  neutron/tests/unit/test_agent_netns_cleanup.py:
  ovs_br_cls.called_once_with('br-int', conf.AGENT.root_helper)

  neutron/tests/unit/test_metadata_agent.py:
  self.eventlet.wsgi.server.called_once_with(

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


Follow ups

References