コード例 #1
0
 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()
コード例 #2
0
 def test_run(self, mock_command):
     action = baremetal.CellV2DiscoverHostsAction()
     action.run(mock.MagicMock())
     mock_command.assert_called_once()