def test_failure(self, mock_command): mock_command.side_effect = processutils.ProcessExecutionError( exit_code=1, stdout='captured stdout', stderr='captured stderr', cmd='command') action = baremetal.CellV2DiscoverHostsAction() result = action.run(mock.MagicMock()) self.assertTrue(result.is_error()) mock_command.assert_called_once()
def test_run(self, mock_command): action = baremetal.CellV2DiscoverHostsAction() action.run(mock.MagicMock()) mock_command.assert_called_once()