summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/api
diff options
context:
space:
mode:
authorRiccardo Pittau <elfosardo@gmail.com>2021-02-19 11:54:30 +0100
committerRiccardo Pittau <elfosardo@gmail.com>2021-02-19 13:16:29 +0000
commit52c01f87cc34c71aa355a53fb5dee8eff0a3a6ba (patch)
treed29332ad563cfab80db0de351224ac9df34eff24 /ironic/tests/unit/api
parent6ed75bc6cf81404a029f36c8ff7f5166769ed2be (diff)
downloadironic-52c01f87cc34c71aa355a53fb5dee8eff0a3a6ba.tar.gz
Enforce autospec in test_notification_utils module
And remove tox.ini filter Change-Id: I29257c805ce0afb01ae9422671d71d225f4b2573
Diffstat (limited to 'ironic/tests/unit/api')
-rw-r--r--ironic/tests/unit/api/controllers/v1/test_notification_utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ironic/tests/unit/api/controllers/v1/test_notification_utils.py b/ironic/tests/unit/api/controllers/v1/test_notification_utils.py
index 3f5b96064..f9d0f38c8 100644
--- a/ironic/tests/unit/api/controllers/v1/test_notification_utils.py
+++ b/ironic/tests/unit/api/controllers/v1/test_notification_utils.py
@@ -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)