def test_cluster_remove_complete(self): ''' Test cluster_remove method ''' mock_cmd_run = MagicMock(return_value=True) with patch.dict(crmshmod.__salt__, {'cmd.retcode': mock_cmd_run}): result = crmshmod.cluster_remove('192.168.1.50', True, True) assert result mock_cmd_run.assert_called_once_with( '{} cluster remove -y -c {} --force -q'.format( crmshmod.CRM_COMMAND, '192.168.1.50'))
def test_cluster_remove_basic(self): ''' Test cluster_remove method ''' mock_cmd_run = MagicMock(return_value=True) with patch.dict(crmshmod.__salt__, {'cmd.retcode': mock_cmd_run}): result = crmshmod.cluster_remove('192.168.1.50') assert result mock_cmd_run.assert_called_once_with( '{crm_command} cluster remove -y -c {host}'.format( crm_command=crmshmod.CRM_COMMAND, host='192.168.1.50'))