Enforce autospec in test_notification_utils module
And remove tox.ini filter Change-Id: I29257c805ce0afb01ae9422671d71d225f4b2573
This commit is contained in:
parent
6ed75bc6cf
commit
52c01f87cc
@ -163,7 +163,8 @@ class APINotifyTestCase(tests_base.TestCase):
|
||||
self.assertEqual(portgroup.standalone_ports_supported,
|
||||
payload.standalone_ports_supported)
|
||||
|
||||
@mock.patch('ironic.objects.node.NodeMaintenanceNotification')
|
||||
@mock.patch('ironic.objects.node.NodeMaintenanceNotification',
|
||||
autospec=True)
|
||||
def test_node_maintenance_notification(self, maintenance_mock):
|
||||
maintenance_mock.__name__ = 'NodeMaintenanceNotification'
|
||||
node = obj_utils.get_test_node(self.context,
|
||||
@ -182,7 +183,7 @@ class APINotifyTestCase(tests_base.TestCase):
|
||||
self.assertEqual(True, payload.maintenance)
|
||||
self.assertEqual('test reason', payload.maintenance_reason)
|
||||
|
||||
@mock.patch.object(notification.NotificationBase, 'emit')
|
||||
@mock.patch.object(notification.NotificationBase, 'emit', autospec=True)
|
||||
def test_emit_maintenance_notification(self, emit_mock):
|
||||
node = obj_utils.get_test_node(self.context)
|
||||
test_level = fields.NotificationLevel.INFO
|
||||
@ -190,4 +191,4 @@ class APINotifyTestCase(tests_base.TestCase):
|
||||
notif_utils._emit_api_notification(self.context, node,
|
||||
'maintenance_set',
|
||||
test_level, test_status)
|
||||
emit_mock.assert_called_once_with(self.context)
|
||||
emit_mock.assert_called_once_with(mock.ANY, self.context)
|
||||
|
2
tox.ini
2
tox.ini
@ -144,8 +144,6 @@ per-file-ignores =
|
||||
ironic/tests/unit/api/controllers/v1/test_volume_connector.py:H210
|
||||
ironic/tests/unit/api/controllers/v1/test_driver.py:H210
|
||||
ironic/tests/unit/api/controllers/v1/test_portgroup.py:H210
|
||||
ironic/tests/unit/api/controllers/v1/test_types.py:H210
|
||||
ironic/tests/unit/api/controllers/v1/test_notification_utils.py:H210
|
||||
ironic/tests/unit/api/controllers/v1/test_port.py:H210
|
||||
ironic/tests/unit/drivers/modules/test_console_utils.py:H210
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user