diff options
Diffstat (limited to 'ironic_python_agent/tests/extensions/decom.py')
| -rw-r--r-- | ironic_python_agent/tests/extensions/decom.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic_python_agent/tests/extensions/decom.py b/ironic_python_agent/tests/extensions/decom.py index 10dc3d84..6a571d28 100644 --- a/ironic_python_agent/tests/extensions/decom.py +++ b/ironic_python_agent/tests/extensions/decom.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import mock from oslotest import base as test_base from ironic_python_agent.extensions import decom @@ -21,3 +22,10 @@ class TestDecomExtension(test_base.BaseTestCase): def setUp(self): super(TestDecomExtension, self).setUp() self.agent_extension = decom.DecomExtension() + + @mock.patch('ironic_python_agent.hardware.get_manager', autospec=True) + def test_erase_hardware(self, mocked_get_manager): + hardware_manager = mocked_get_manager.return_value + result = self.agent_extension.erase_hardware('erase_hardware') + result.join() + hardware_manager.erase_devices.assert_called_once_with() |
