diff --git a/ironic/tests/unit/drivers/modules/test_ipxe.py b/ironic/tests/unit/drivers/modules/test_ipxe.py index 87444a5859..a9ecdab34c 100644 --- a/ironic/tests/unit/drivers/modules/test_ipxe.py +++ b/ironic/tests/unit/drivers/modules/test_ipxe.py @@ -227,7 +227,7 @@ class iPXEBootTestCase(db_base.DbTestCase): # and refactored as we begin to separate PXE and iPXE interfaces. @mock.patch.object(manager_utils, 'node_get_boot_mode', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) @mock.patch.object(pxe_utils, 'get_image_info', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @@ -659,7 +659,7 @@ class iPXEBootTestCase(db_base.DbTestCase): boot_devices.PXE, persistent=True) - @mock.patch('os.path.isfile', return_value=False) + @mock.patch('os.path.isfile', return_value=False, autospec=True) @mock.patch.object(pxe_utils, 'create_pxe_config', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) @mock.patch.object(deploy_utils, 'switch_pxe_config', autospec=True) @@ -708,7 +708,7 @@ class iPXEBootTestCase(db_base.DbTestCase): @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) @mock.patch.object(deploy_utils, 'switch_pxe_config', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) def test_prepare_instance_netboot_missing_root_uuid( @@ -745,7 +745,7 @@ class iPXEBootTestCase(db_base.DbTestCase): @mock.patch.object(pxe_base.LOG, 'warning', autospec=True) @mock.patch.object(pxe_utils, 'clean_up_pxe_config', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) def test_prepare_instance_whole_disk_image_missing_root_uuid( diff --git a/ironic/tests/unit/drivers/modules/test_pxe.py b/ironic/tests/unit/drivers/modules/test_pxe.py index 4795a062f8..79fb2952f5 100644 --- a/ironic/tests/unit/drivers/modules/test_pxe.py +++ b/ironic/tests/unit/drivers/modules/test_pxe.py @@ -224,7 +224,7 @@ class PXEBootTestCase(db_base.DbTestCase): @mock.patch.object(manager_utils, 'node_get_boot_mode', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) @mock.patch.object(pxe_utils, 'get_image_info', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @@ -581,7 +581,7 @@ class PXEBootTestCase(db_base.DbTestCase): boot_devices.PXE, persistent=True) - @mock.patch('os.path.isfile', return_value=False) + @mock.patch('os.path.isfile', return_value=False, autospec=True) @mock.patch.object(pxe_utils, 'create_pxe_config', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) @mock.patch.object(deploy_utils, 'switch_pxe_config', autospec=True) @@ -629,7 +629,7 @@ class PXEBootTestCase(db_base.DbTestCase): @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) @mock.patch.object(deploy_utils, 'switch_pxe_config', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) def test_prepare_instance_netboot_missing_root_uuid( @@ -664,7 +664,7 @@ class PXEBootTestCase(db_base.DbTestCase): @mock.patch.object(pxe_base.LOG, 'warning', autospec=True) @mock.patch.object(pxe_utils, 'clean_up_pxe_config', autospec=True) @mock.patch.object(manager_utils, 'node_set_boot_device', autospec=True) - @mock.patch.object(dhcp_factory, 'DHCPFactory') + @mock.patch.object(dhcp_factory, 'DHCPFactory', autospec=True) @mock.patch.object(pxe_utils, 'cache_ramdisk_kernel', autospec=True) @mock.patch.object(pxe_utils, 'get_instance_image_info', autospec=True) def test_prepare_instance_whole_disk_image_missing_root_uuid( diff --git a/tox.ini b/tox.ini index a8fe6aea23..d45bbb6037 100644 --- a/tox.ini +++ b/tox.ini @@ -134,9 +134,7 @@ per-file-ignores = ironic/tests/unit/conductor/*:H210 ironic/tests/unit/common/*:H210 ironic/tests/unit/drivers/modules/test_console_utils.py:H210 - ironic/tests/unit/drivers/modules/test_ipxe.py:H210 ironic/tests/unit/drivers/modules/test_iscsi_deploy.py:H210 - ironic/tests/unit/drivers/modules/test_pxe.py:H210 ironic/tests/unit/drivers/modules/test_snmp.py:H210 ironic/tests/unit/drivers/modules/network/*:H210 ironic/tests/unit/drivers/modules/ilo/*:H210